1 (edited by steveotron 2012-06-16 13:15:01)

Topic: Assistance with renaming syntax and tag scripts (coming from mp3tag)

Hi, I've been using mp3tag for years, and I'm having a little trouble figuring out how to set up strings in MusicBrainz Picard. Below are the strings that I have for mp3tag that do the things that I want:

$replace('['%year%']' %album%\$num(%track%,2) %title%,/,-,|,-,:,-,",'''',?,_,>,-,<,-,*,^)

creates: [2012] The Lost Tapes/01 Millionenspiel.mp3

I just want a "[YEAR] ALBUM NAME/TRACK NUMBER TITLE" format, and the stuff after %title% replaces characters that Windows can't read (e.g., / is replaced with -, : is replaced with -, * is replaced with ^, and so on). I use OSX on a hackintosh but I boot into Windows sometimes and like things to be compatible. Also, I want to make sure that that the replacement of non-Windows compatible characters occurs not only for the title of the song, but also for the name of the album; I think that's why I had the $replace at the beginning.

This string is basically the same except it adds the disc number for releases with multiple discs:

$replace('['%year%']' %album%\[$num(%discnumber%,1)]-$num(%track%,2) %title%,/,-,|,-,:,-,",'''',?,_,>,-,<,-,*,^)

creates: [2012] The Lost Tapes/1-01 Millionspiel.mp3

As for tagging scripts, I'm not sure how to set them up. I'm fine with what Picard picks up for tags, although I would like to make sure that the original release date is retrieved and is what is used in the ID tags and that the renaming process also uses the original release date (common issue with mp3tag for reissues). And just for clarity, I want the tags to not replace non-Windos compatible characters, and the replacement should only occur for the file names.

Please let me know if anything didn't make sense, and thanks in advance.

Re: Assistance with renaming syntax and tag scripts (coming from mp3tag)

$if(%date%,[$left(%date%, 4)] ,)%album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2) %title%

should do nearly everything you want - it won't replace windows-incompatible characters though, since picards $replace isn't quite as clever as mp3tags (I think). You can use the builtin option to automatically replace these characters with an underscore (it's on the same options page).

3 (edited by steveotron 2012-06-16 15:32:54)

Re: Assistance with renaming syntax and tag scripts (coming from mp3tag)

Mineo wrote:
$if(%date%,[$left(%date%, 4)] ,)%album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2) %title%

should do nearly everything you want - it won't replace windows-incompatible characters though, since picards $replace isn't quite as clever as mp3tags (I think). You can use the builtin option to automatically replace these characters with an underscore (it's on the same options page).

Thanks, Mineo! I've tried this out and it's worked great, and I think I've made sense of the code string you've posted.

$if(%date%,[$left(%date%, 4)] ,) = if date is retrieved, use the date and use the first 4 characters (essentially the year)
$if($gt(%totaldiscs%,1),%discnumber%-,) = if the total number of discs is greater than 1, include disc number (with the dash)

The only thing I changed was to use %originaldate% tag instead when creating the [YEAR] portion of the folder. I do have a question in regards to that: let's say for some reason there is no %originaldate% retrieved for whatever reason; should I then use a statement that then uses the %date% tag? If so, could I set this up?

I noticed that my ID3 tags still write the reissue date, however, so I'm still unsure how to change the tagger script in "Advanced Settings" to change that.

As for the replacement of characters, I think I might just use that feature that replaces everything with underscores just to keep things simple, so I'll use that from now on and just rename my old files in my library to that scheme too.

Re: Assistance with renaming syntax and tag scripts (coming from mp3tag)

steveotron wrote:
Mineo wrote:
$if(%date%,[$left(%date%, 4)] ,)%album%/$if($gt(%totaldiscs%,1),%discnumber%-,)$num(%tracknumber%,2) %title%

Thanks, Mineo! I've tried this out and it's worked great, and I think I've made sense of the code string you've posted.

$if(%date%,[$left(%date%, 4)] ,) = if date is retrieved, use the date and use the first 4 characters (essentially the year)
$if($gt(%totaldiscs%,1),%discnumber%-,) = if the total number of discs is greater than 1, include disc number (with the dash)

Both are correct.

steveotron wrote:

The only thing I changed was to use %originaldate% tag instead when creating the [YEAR] portion of the folder. I do have a question in regards to that: let's say for some reason there is no %originaldate% retrieved for whatever reason; should I then use a statement that then uses the %date% tag? If so, could I set this up?

The %originaldate% tag comes from the first-release-date element of the release group (click) which I expect is always set if there's at least one date in the release group - so, in theory, if there's a %date% for the release, there has to be an %originaldate% for the group (and thus the release in picard) as well.

steveotron wrote:

I noticed that my ID3 tags still write the reissue date, however, so I'm still unsure how to change the tagger script in "Advanced Settings" to change that.

%originaldate% is saved to a different tag than %date% (click) - you might be able to $set(%date%, %originaldate%) (or $set(date, %originaldate%), I'm not entirely sure) to make %date% the same as %originaldate%

Re: Assistance with renaming syntax and tag scripts (coming from mp3tag)

Mineo wrote:

you might be able to $set(%date%, %originaldate%) (or $set(date, %originaldate%), I'm not entirely sure) to make %date% the same as %originaldate%

Either of these two should work fine:

$set(date,%originaldate%)
$copy(date,originaldate)

Re: Assistance with renaming syntax and tag scripts (coming from mp3tag)

Thank you both. The string and tagging scripts have been working great so far.