Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Random folder custom directories
« previous next »
  • Print
Pages: [1]

Author Topic: Random folder custom directories  (Read 3815 times)

Offline Mmmm

  • Developer
  • Member
  • *
  • Posts: 922
Random folder custom directories
« on: April 24, 2007, 01:16:02 PM »
I find it quite annoying that every time I scan my folders with the random_folder_advance plugin, I always have to delete a large number of folders from the list so that radio recordings and other things aren't picked. As I change the contents of my drive fairly often this happens all the time.

So I have written a patch so that you can permanently store the folders that you want scanned in a file and then only these files are scanned.
Here it is:
FS #7074

You must create a text file in /.rockbox called "folder_advance_dir.txt" and in this file you should put your directories.

eg.
if your root folder contains:
CDs--------> a-m
 Â  --------> n-z
 Â  -------->favourites
downloads-->a-m
 Â        -->n-z
pictures

if you make your folder_advance_dir.txt look like this:
Code: [Select]
CDs
downloads/a-m

then just
CDs--------> a-m
 Â  --------> n-z
 Â  -------->favourites
downloads-->a-m

will be scanned and you won't have to delete
downloads-->n-z
pictures

A nifty side effect of this is that if you put this into your folder_advance_dir.txt file
Code: [Select]
CDs
CDs/favourites
downloads/a-m
then the favourites folder will be twice as likely to be picked than any other folder!
So you can put a bias on any folders you like!  :o

What do you think?
Please test it... :-) (only one smiley allowed per post??)
Logged
My H120 build with Recording Enhancements Pack
Some examples of recordings done on H140 with Rockbox

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Random folder custom directories
« Reply #1 on: April 24, 2007, 10:25:24 PM »
Smileys aren't too useful in a technical forum. I had limited it to three, and discovered that still didn't discourage people from using three of the ??? smilies after questions (as opposed to 6 or 7 as was in the past).

I really only see the smilies as being useful (in a practical sense) when using the winking one to denote that something is a joke or meant in jest. So I decided that you can probably safely get away with one.
Logged

Offline PaulJam

  • Member
  • *
  • Posts: 170
Re: Random folder custom directories
« Reply #2 on: April 25, 2007, 06:13:28 AM »
Hi,

nice feature.

I was wondering if this could be extended to also be able to specify folders that should not be included in the folderlist. For example in my music directory i have a folder "various artists" that i don't want to be played in random folder mode. With your patch i still have to delete this one manually from the folderlist.
Logged

Offline Mmmm

  • Developer
  • Member
  • *
  • Posts: 922
Re: Random folder custom directories
« Reply #3 on: April 25, 2007, 04:39:40 PM »
Hmm... I'll have a think about that...will be a bit trickier though I think...
Logged
My H120 build with Recording Enhancements Pack
Some examples of recordings done on H140 with Rockbox

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Random folder custom directories
« Reply #4 on: April 25, 2007, 08:08:00 PM »
changing it to use a whitelist and a blacklist should be fairl trivial... just it will takes ages if the list is fairly big :(
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Mmmm

  • Developer
  • Member
  • *
  • Posts: 922
Re: Random folder custom directories
« Reply #5 on: April 27, 2007, 06:13:42 PM »
Quote from: PaulJam on April 25, 2007, 06:13:28 AM
Hi,

nice feature.

I was wondering if this could be extended to also be able to specify folders that should not be included in the folderlist. For example in my music directory i have a folder "various artists" that i don't want to be played in random folder mode. With your patch i still have to delete this one manually from the folderlist.

Ok, it's done....

To exclude a directory and all its subdirectories type -/DIRNAME as a line in the file "folder_advance_dir.txt"
eg:
Code: [Select]
-/Cds

If you want to include the subdirectories, you will need two lines
Code: [Select]
CDs
-/CDs

So from the previous example (in the first post),
Code: [Select]
CDs
CDs/favourites
downloads/a-m
-/CDs
-/CDs/a-m
This would result in a biased favourites folder, /downloads/a-m and all sub dirs, and everything in CDs not including CDs itself and CDs/a-m and its subdirs.

Does that make sense?

EDIT: oh I forgot to say, you can have a max of 10 "removed" dirs (easily increased if that is too few). I've done it this way so that every entry doesn't have to be compared with the whole file, meaning it should be quicker.
« Last Edit: April 27, 2007, 06:18:59 PM by Mmmm »
Logged
My H120 build with Recording Enhancements Pack
Some examples of recordings done on H140 with Rockbox

Offline PaulJam

  • Member
  • *
  • Posts: 170
Re: Random folder custom directories
« Reply #6 on: April 28, 2007, 02:05:55 AM »
Hi,

it works great now.
Thank you very much.

Btw. without a little modification of the patch, hunk 1 fails.
See http://svn.rockbox.org/viewvc.cgi/trunk/apps/plugins/random_folder_advance_config.c?r1=13232&r2=13233
Logged

Offline Mmmm

  • Developer
  • Member
  • *
  • Posts: 922
Re: Random folder custom directories
« Reply #7 on: April 28, 2007, 06:32:25 AM »
Ok ta, that's fixed now (I should update more often :D)
Logged
My H120 build with Recording Enhancements Pack
Some examples of recordings done on H140 with Rockbox

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Random folder custom directories
« Reply #8 on: April 28, 2007, 06:38:00 AM »
hmm... youve gone about it in an odd way,
why not have a seperate whitelist and blacklist file?
load the whitelist, recursivly add each folder from that, then load the blacklist and remove each folder in that list?
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Mmmm

  • Developer
  • Member
  • *
  • Posts: 922
Re: Random folder custom directories
« Reply #9 on: April 28, 2007, 07:54:54 AM »
Because
i) you'd need two files (bit messy?)
ii) actually removing each dir after they have been inserted means that it would be slower than the way it is now (ie not entering them in the first place)
iii) if you wanted to exclude a whole tree you would have to remove each seperately (ie lots of entries) - although it would be possible to do this recursivly too but that would slow things down even more.

See...there is method in my madness :D, What do you think?
« Last Edit: April 28, 2007, 07:58:07 AM by Mmmm »
Logged
My H120 build with Recording Enhancements Pack
Some examples of recordings done on H140 with Rockbox

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Random folder custom directories
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.087 seconds with 15 queries.