Based on some of the posts in this thread and my modifications I use:
Single Artists
$rreplace($replace($rreplace($replace($replace($if2(%albumartistsort%,%artistsort%),...,…),/,-),\\.\$,$noop(.))/$rreplace($replace($replace($if2(%albumartist%,%artist%),...,…),/,-),\\.\$,$noop(.)) - $rreplace($replace(%album%,...,…),\\.\$,$noop(.))$if($if2(%originalyear%,%date%), [$left($if2(%originalyear%,%date%),4)])/$num(%tracknumber%,2) - $rreplace($replace($replace(%artist%,...,…),/,-),\\.\$,$noop(.)) - $replace(%title%,...,…),_,$noop(.)),[*|:"<>?],)
Multiple Artists
$rreplace($replace($if($eq(%albumartist%,Various Artists),AAVV,$rreplace($replace($replace($if2(%albumartistsort%,%artistsort%),...,…),/,-),\\.\$,$noop(.)))/$rreplace($replace($replace($if2(%albumartist%,%artist%),...,…),/,-),\\.\$,$noop(.)) - $rreplace($replace(%album%,...,…),\\.\$,$noop(.))$if($if2(%originalyear%,%date%), [$left($if2(%originalyear%,%date%),4)])/$num(%tracknumber%,2) - $rreplace($replace($replace(%artist%,...,…),/,-),\\.\$,$noop(.)) - $replace(%title%,...,…),_,$noop(.)),[*|:"<>?],)
Example:
File name:
Beatles, The\The Beatles - Help! [1965]\07 - The Beatles - Ticket to Ride.mp3
Multiple artist file name:
AAVV\Various Artists - Explosive Doowops, Volume 4 [1999]\05 - The Fantasy - Why Oh Why.mp3
The features of these strings are:
1) Unusable filename characters are removed so that no underscore replacement takes place (i.e. Why Oh Why.mp3 instead of Why_ Oh Why_.mp3)
2) All albums by an artist are collected within the directory using the artist sort name - however within such directory the standard artist name is used
3) The date of the album - if present - is included in the album directory at the end (otherwise omitted). This is done to avoid inconsistent naming between those albums with date information and those without
4) The artist name is kept within the actual filename of track so that were a single song to be extracted from an album the key information would still be available in the filename itself (the fact that the track number is at the very beginning of the file name is to facilitate its removal through manual editing if necessary)
On top of that the following benefits are included and were taken from previous posts:
a. If the ArtistName, AlbumName or TrackName contain a three-dot "..." sequence, it will be replaced with a true ellipsis "…"
b. If the ArtistName or AlbumName ends in a dot "." then that dot will be removed
c. Finally, any and all underscores "_" will be removed from the entire path
d. Multi-artist albums attributed to a specific artist will have files placed into the same directory structure as the single artist albums
EDIT NOTE
The string uses the option %originalyear% and, if not present, %date% to set the date of the album folder. Since the time I have posted the script I have decided to remove the %originalyear% and just use %date% for my personal use. I leave the script here as it is because it is a more complex script and can be easily modified, however it is important that people using it are aware of such choice.
----NEW STRING 23/07/2009---
Based on the discussion in another section of the forum (http://forums.musicbrainz.org/viewtopic … 7896#p7896) I have decided to create an alternative version of the previous string (minus the original year aspect) that groups all discs of a given release in the same release group.
The following strings require:
1. the Disc Numbers plugin (http://musicbrainz.org/doc/PicardQt/Plugins)
2. the Bonus Disc plugin (http://musicbrainz.org/doc/PicardQt/Plugins)
3. the following code added to the Scripting section of Picard
$if(%discnumber%,$set(albumdisc,$if(%discsubtitle%,%album% \(disc %discnumber% - %discsubtitle%\),%album% \(disc %discnumber%\))))
$if(%bonusdisc%,$set(albumdisc,$if(%bonusdisctitle%,%album% \(bonus disc - %bonusdisctitle%\),%album% \(bonus disc\))))
Once (1) to (3) have been carried out the strings are:
Single Artist
$replace($replace($replace($replace($replace($replace($replace($replace($replace($rreplace($replace($replace($if2(%albumartistsort%,%artistsort%),...,…),/,-),\\.\$,$noop(.))/$rreplace($replace($replace($if2(%albumartist%,%artist%),...,…),/,-),\\.\$,$noop(.)) - $rreplace($replace(%album%,...,…),\\.\$,$noop(.))$if(%date%, [$left(%date%,4)])/$if(%albumdisc%,$rreplace($replace($replace(%albumdisc%,...,…),/,-),\\.\$,$noop(.))/,)$num(%tracknumber%,2) - $rreplace($replace($replace(%artist%,...,…),/,-),\\.\$,$noop(.)) - $replace(%title%,...,…),_,$noop(.)),?,),_, ),*,x),:, -),",'),|, ),<,[),>,])
Multiple Artists
$replace($replace($replace($replace($replace($replace($replace($replace($replace($if($eq(%albumartist%,Various Artists),AAVV,$rreplace($replace($replace($if2(%albumartistsort%,%artistsort%),...,…),/,-),\\.\$,$noop(.)))/$rreplace($replace($replace($if2(%albumartist%,%artist%),...,…),/,-),\\.\$,$noop(.)) - $rreplace($replace(%album%,...,…),\\.\$,$noop(.))$if(%date%, [$left(%date%,4)])/$if(%albumdisc%,$rreplace($replace($replace(%albumdisc%,...,…),/,-),\\.\$,$noop(.))/,)$num(%tracknumber%,2) - $rreplace($replace($replace(%artist%,...,…),/,-),\\.\$,$noop(.)) - $replace(%title%,...,…),_,$noop(.)),?,),_, ),*,x),:, -),",'),|, ),<,[),>,])
As mentioned all the features of the original strings persists (but original year as explained in the previous edit) the additional feature provided by the changes is:
instead of
Beatles, The\The Beatles - Help! (disc 1: Just an example) [1965]\07 - The Beatles - Ticket to Ride.mp3
Beatles, The\The Beatles - Help! (disc 2: Just another example) [1965]\07 - The Beatles - Ticket to Ride.mp3
Beatles, The\The Beatles - Help! (bonus disc: why not) [1965]\07 - The Beatles - Ticket to Ride.mp3[/i]
the end result is
Beatles, The\The Beatles - Help! [1965]\Help! (disc 1 - Just an example)\07 - The Beatles - Ticket to Ride.mp3
Beatles, The\The Beatles - Help! [1965]\Help! (disc 2 - Just another example)\07 - The Beatles - Ticket to Ride.mp3
Beatles, The\The Beatles - Help! [1965]\Help! (bonus disc - why not)\07 - The Beatles - Ticket to Ride.mp3
Furthermore it also includes the updated replacement string developed by Kelani (http://forums.musicbrainz.org/viewtopic.php?id=1769)
Specifically:
? to <nothing>
_ to <space>
* to x (To note unreleased/demo tracks: 01. SomeBand - SuperSecret Track [x].mp3 )
: to <space>-
/ to - this specific replacement does not appear to work
I have also added the following replacements
" to '
| to <nothing>
< to [
> to ]
NGS update 02 July 2011
Below are the strings I am using with NGS to account for the different treatment of disc numbers
Single Artist
$if2(%albumartistsort%,%artistsort%)/$if2(%albumartist%,%artist%) - %album%$if(%date%, [$left(%date%,4)])$if($gt(%totaldiscs%,1),/%album% \(disc %discnumber%$if(%discsubtitle%, - %discsubtitle%)\))/$num(%tracknumber%,2) - %artist% - %title%
Various Artists
$if($eq(%albumartist%,Various Artists),AAVV/,$if2(%albumartistsort%,%artistsort%)/$if2(%albumartist%,%artist%) - )%album%$if(%date%, [$left(%date%,4)])/$if($gt(%totaldiscs%,1),/%album% \(disc %discnumber%$if(%discsubtitle%, - %discsubtitle%)\))/$num(%tracknumber%,2) - %artist% - %title%
For clarity I have removed the "replace" parts of the code
The code with the missing "replace" is below:
Single Artist
$replace($replace($replace($replace($replace($replace($replace($replace($replace($rreplace($replace($replace($if2(%albumartistsort%,%artistsort%),...,…),/,-),\\.\$,$noop(.))/$rreplace($replace($replace($if2(%albumartist%,%artist%),...,…),/,-),\\.\$,$noop(.)) - $rreplace($replace(%album%,...,…),\\.\$,$noop(.))$if(%date%, [$left(%date%,4)])/$if($gt(%totaldiscs%,1),/$rreplace($replace(%album%,...,…),\\.\$,$noop(.)) \(disc %discnumber%$if(%discsubtitle%, - $rreplace($replace(%discsubtitle%,...,…),\\.\$,$noop(.)))\)/)$num(%tracknumber%,2) - $rreplace($replace($replace(%artist%,...,…),/,-),\\.\$,$noop(.)) - $replace(%title%,...,…),_,$noop(.)),?,),_, ),*,x),:, -),",'),|, ),<,[),>,])
Multiple Artists
$replace($replace($replace($replace($replace($replace($replace($replace($replace($if($eq(%albumartist%,Various Artists),AAVV/,$rreplace($replace($replace($if2(%albumartistsort%,%artistsort%),...,…),/,-),\\.\$,$noop(.))/$rreplace($replace($replace($if2(%albumartist%,%artist%),...,…),/,-),\\.\$,$noop(.)) - )$rreplace($replace(%album%,...,…),\\.\$,$noop(.))$if(%date%, [$left(%date%,4)])/$if($gt(%totaldiscs%,1),/$rreplace($replace(%album%,...,…),\\.\$,$noop(.)) \(disc %discnumber%$if(%discsubtitle%, - $rreplace($replace(%discsubtitle%,...,…),\\.\$,$noop(.)))\)/)$num(%tracknumber%,2) - $rreplace($replace($replace(%artist%,...,…),/,-),\\.\$,$noop(.)) - $replace(%title%,...,…),_,$noop(.)),?,),_, ),*,x),:, -),",'),|, ),<,[),>,])
Update 03 July 2011
A variation that was introduced in the previous string is the following: if the album artist is "Various Artist" then the files are saved within the folder AAVV\Album (and individual discs if present) rather than (as was the case with previous strings) into AAVV\Various Artists - Album.
The key reason behind the change was ease of access: i.e. if an album is sitting within the AAVV folder I already know it's a "Various Artist" and as such it does not provide further insight into the data and it's less easy to access the directories when browsing the folders.
The change however introduced a secondary annoyance: a significant number of albums start with "The ". This is not an issue when the directories are structured "Artist - Album", but it's not the behaviour I want when the directories are named "Album" only.
As I do not believe there is a %albumsort% variable (as there is %artistsort%) I have made the following modification:
1. Scripting section added the line:
$set(albumsorted,$if($eq(%albumartist%,Various Artists),$if($eq($left(%album%,4),The ),$right(%album%,$sub($len(%album%),4)) \(The\),%album%),%album%))
This script creates a variable called %albumsorted% which (when the album artist is Various Artist and the album name starts with "The ...") stores the value "Album (The)" (rather than "The Album")
2. Single artist (unchanged from 02 July 2011)
$replace($replace($replace($replace($replace($replace($replace($replace($replace($rreplace($replace($replace($if2(%albumartistsort%,%artistsort%),...,…),/,-),\\.\$,$noop(.))/$rreplace($replace($replace($if2(%albumartist%,%artist%),...,…),/,-),\\.\$,$noop(.)) - $rreplace($replace(%album%,...,…),\\.\$,$noop(.))$if(%date%, [$left(%date%,4)])/$if($gt(%totaldiscs%,1),/$rreplace($replace(%album%,...,…),\\.\$,$noop(.)) \(disc %discnumber%$if(%discsubtitle%, - $rreplace($replace(%discsubtitle%,...,…),\\.\$,$noop(.)))\)/)$num(%tracknumber%,2) - $rreplace($replace($replace(%artist%,...,…),/,-),\\.\$,$noop(.)) - $replace(%title%,...,…),_,$noop(.)),?,),_, ),*,x),:, -),",'),|, ),<,[),>,])
3. Multiple artists
$replace($replace($replace($replace($replace($replace($replace($replace($replace($if($eq(%albumartist%,Various Artists),AAVV/,$rreplace($replace($replace($if2(%albumartistsort%,%artistsort%),...,…),/,-),\\.\$,$noop(.))/$rreplace($replace($replace($if2(%albumartist%,%artist%),...,…),/,-),\\.\$,$noop(.)) - )$rreplace($replace(%albumsorted%,...,…),\\.\$,$noop(.))$if(%date%, [$left(%date%,4)])/$if($gt(%totaldiscs%,1),/$rreplace($replace(%album%,...,…),\\.\$,$noop(.)) \(disc %discnumber%$if(%discsubtitle%, - $rreplace($replace(%discsubtitle%,...,…),\\.\$,$noop(.)))\)/)$num(%tracknumber%,2) - $rreplace($replace($replace(%artist%,...,…),/,-),\\.\$,$noop(.)) - $replace(%title%,...,…),_,$noop(.)),?,),_, ),*,x),:, -),",'),|, ),<,[),>,])