google-code-export / beets

Automatically exported from code.google.com/p/beets
MIT License
0 stars 0 forks source link

Feature Request: Ability to handle valid character ranges in paths #386

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My path structure is as follows:
default: 
%asciify{Albums/%upper{%left{$albumartist,1}}/$albumartist_sort/[%if{$year,$year
,0000}] $album%aunique{}/$track - $title}

However, not all musicians and bands are particularly friendly with regards to 
ASCII, so I end up with this in my Albums directory:

$ ls -l
total 16
drwxr-xr-x  3 user user   21 May 17 14:38 _
drwxr-xr-x  3 user user   54 May 17 14:37 _._
drwxr-xr-x  3 user user   14 May 17 14:38 -
drwxr-xr-x  3 user user   16 May 17 09:15 !
drwxr-xr-x  3 user user   25 May 17 09:17 1
drwxr-xr-x  4 user user   33 May 17 09:19 2
drwxr-xr-x 72 user user 4096 May 17 14:38 A
drwxr-xr-x 71 user user 4096 May 17 14:38 B
drwxr-xr-x 14 user user 4096 May 17 14:38 C

Which is not terribly convenient. It would be nice if there was a way to 
specify a valid range of characters (for example, I'd allow A-Z), and then 
specify a substitute string if the character fell outside the range. That way 
I'd sort all my numbered and just plain oddly named bands into a single 
directory (hereby dubbed the leper colony).

I'd like to see something like this:
$ ls -l 
total 16
drwxr-xr-x  4 user user   33 May 17 09:19 0-9+
drwxr-xr-x 72 user user 4096 May 17 14:38 A
drwxr-xr-x 71 user user 4096 May 17 14:38 B
drwxr-xr-x 14 user user 4096 May 17 14:38 C
drwxr-xr-x 18 user user 4096 May 17 14:37 T

Original issue reported on code.google.com by mikemacl...@gmail.com on 17 May 2012 at 6:51

GoogleCodeExporter commented 9 years ago
This could be implemented by a nice %initial{} function that's smart about 
making one-letter directory names.

Original comment by adrian.sampson on 17 May 2012 at 6:57

untitaker commented 9 years ago

Do not comment here, but on sampsyo/beets#167