Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Help needed with output style and filename formatting (Read 2148 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Help needed with output style and filename formatting

Basically, I'm trying to figure out this formatting style for conversion filenaming so my music collection would be styled like this (best show this on an example):

...\Music\Pearl Jam\[1991] Ten\1.01 - Once.flac
...\Music\Pearl Jam\[1991|2009] Ten\1.01 - Once.flac

Most of it is self-explanatory, but the tricky part to do here (automatically) is the year part. For example, this album, Ten, was re-released in 2009, and if the year of release differs from the original date of release, I want that to show in the filename/directory structure.

I tag my music with the MusicBrainz Picard semi-automatic tagger, which saves the date of release in %date%, and creates a new tag named 'ORIGINALDATE' to store the original date of release. What I've come up so far (posting just the part in brackets as everything else works!):

'['$left($meta(originaldate),4)$if($left($meta(originaldate),4)==$left(%date%,4),,|$left(%date%,4))']'

I'm using the $left(string,4) function as Picard stores dates in the format yyyy-mm-dd and extracting the four left characters gives you the year.

So, as I said, this isn't working right now (the else statement does not execute) and if anybody could help me, thanks a lot!


Help needed with output style and filename formatting

Reply #2
The pipe "|" is an invalid character for file and folder names. foobar interprets its presence in a string as a backslash "\" using Copy or Move in File Operations. Thus it will result in a folder named "[1991" containing a folder named "2009] Ten".

Now, as for what I'd use to accomplish what you want:
Code: [Select]
'['[$if($stricmp($year(%originaldate%),$year(%date%)),,$year(%originaldate%)-)]$year(%date%)']'

However, you might want to reconsider using this at all since it will result in multiple folders for an album when the tracks of that album have differing "originaldate" tags such as artist compilations/retrospectives.