Skip to main content
Topic: Diskwriter output file name formatting (Read 6496 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Diskwriter output file name formatting

I am having problems with the diskwriter output file name formatting. I am converting from CD to MPC. Here's the string I am trying to use:
%artist%\%date% - %album%\[disc %disc%\]$num(%tracknumber%,2) - %title%[/b]

It gives me [SYNTAX ERROR IN FORMATTING STRING].

I am trying to create additional subdirectories only when there is a disc value in the tag.

Can anyone tell me what's wrong with the string?

Diskwriter output file name formatting

Reply #1
use
Code: [Select]
%artist%\%date% - %album%\[disc %disc%]\$num(%tracknumber%,2) - %title%

Note the position of the backslashes.

Diskwriter output file name formatting

Reply #2
I thought leaving the backslash outside of the [ ] characters would make CDs without a disc number try to create a subfolder with no name. But your formatting works perfectly. Thank Foosion! 

Diskwriter output file name formatting

Reply #3
Successive backslashes are merged into one; you cannot create files or directories with an empty name.

Diskwriter output file name formatting

Reply #4
Along the same lines, I'm trying to get Foobar's diskwriter output to structure the directory tree for Various Artist albums differently than Single Artist ones.  So, my output file name formatting string might be (generically) something like:

Code: [Select]
$if($stricmp($directory(%_path%,2),Various Artists),%_filename%,blah\%_filename%)


The above returns a syntax error.  The following does not return an error, however (but doesn't do what I want, either) and is only different by a '\' character:

Code: [Select]
$if($stricmp($directory(%_path%,2),Various Artists),%_filename%,blah %_filename%)


This leads me to believe I misunderstand something about path specifications within the $if(a,b,c) construct.  Any suggestions?  My directory structure is <first letter of artist name>\%artist%\%album%\%track% and the 'Various Artists' folder is at the <first letter of artist name> level.  For single artists, I know that this works:

Code: [Select]
$directory(%_path%,3)\%artist%\'('%date%')' %album%\%_filename%


So, what about the $if(a,b,c) am I hosing up?  If someone would be so kind, that is.

Cheers,

Matt

Diskwriter output file name formatting

Reply #5
so there's actually still an issue here, something i've been fighting for a bit, and noting it coming to a head. while it's true that no extra directories will be created, the file's location in the database _does_ contain a double backslash. this causes two problems: the "open directory" context menu does not work and reports that the directory does not exist, and secondly, if the file is manually dragged onto a playlist or similar, it will get added to the database again, and the duplicate will not get removed by the "remove dead entries" button. here is the formatting string i am using:

Code: [Select]
$if($and($lower(%albumartist%),$not(%singletrack%)),$lower(%albumartist%),$lower(%artist%))/[$if($not(%singletrack%),$lower(%album%))]/[$num(%disc%,1)][$if($not(%singletrack%),$num(%tracknumber%,2)).]$replace($lower(%artist%-%title%),' ',_)


this leads to entries like "C:\storage\mp3\daft punk\daft_punk-musique_(long_version).mp3" alongside "C:\storage\mp3\daft punk\\daft_punk-musique_(long_version).mp3". either the masstagger should allow for backslashes to be inside of conditionals, or foobar's database should trim double backslashes.

Diskwriter output file name formatting

Reply #6
'scuse me but i could need some help with formattingstring for diskwriter... 

well, what i would have liked is that diskwriter choose this string if inputfile(s) are properly tagged:
Code: [Select]
%artist%\%album% ['('%date%')']\[disc %disc%]\['['$num(%tracknumber%,2)']']  %title%

...but if inputfile(s) are missing tags/info alltogether it goes to the default formatting string:
Code: [Select]
$num(%_diskwriter_index%,3) %_filename%

- is it possible to merge these two strings into one like that? i don't seem capable of doing it myself anyways..... 
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

Diskwriter output file name formatting

Reply #7
Try:
Code: [Select]
$if($and(%artist%,%album%,%title%),%artist%)\$if($and(%artist%,%album%,%title%),%album% ['('%date%')'])\$if($and(%artist%,%album%,%title%),[disc %disc%])\$if($and(%artist%,%album%,%title%),['['$num(%tracknumber%,2)']']  %title%,$num(%_diskwriter_index%,3) %_filename%)


I considered that "if inputfile(s) are properly tagged" means "if %artist%, %album% and %title% do exist as tags for the same file".

Diskwriter output file name formatting

Reply #8
Thanks for quick response!
I had to trottle off to work, so I won't get a chance to try the string 'till tomorrow, but I'm sure it will work out just fine. 
Quote
I considered that "if inputfile(s) are properly tagged" means "if %artist%, %album% and %title% do exist as tags for the same file".

Probably how I would have intended a definition if I had gotten 'round to some actual thinking..... 
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

Diskwriter output file name formatting

Reply #9
Thankyou! Worked very smoothly 
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

Diskwriter output file name formatting

Reply #10
One thing I had not taken into consideration are Various Artists albums. There also seems to be two different fields, %albumartist% and %album artist% (randomly? it would be easier if it was just one standard field...) used for this. So the original string:
Code: [Select]
$if($and(%artist%,%album%,%title%),%artist%)\$if($and(%artist%,%album%,%title%),%album% ['('%date%')'])\$if($and(%artist%,%album%,%title%),[disk %disc%])\$if($and(%artist%,%album%,%title%),['['$num(%tracknumber%,2)']']  %title%,$num(%_diskwriter_index%,3)  %_filename%)

will work very well with almost everything, but for a "Various Artists" album it has to be either
Code: [Select]
$if($and(%album artist%,%album%,%title%),%album artist%)\$if($and(%album artist%,%album%,%title%),%album% ['('%date%')'])\$if($and(%album artist%,%album%,%title%),[disk %disc%])\$if($and(%album artist%,%album%,%title%),['['$num(%tracknumber%,2)']']  %artist% - %title%,$num(%_diskwriter_index%,3)  %_filename%)

or
Code: [Select]
$if($and(%albumartist%,%album%,%title%),%albumartist%)\$if($and(%albumartist%,%album%,%title%),%album% ['('%date%')'])\$if($and(%albumartist%,%album%,%title%),[disk %disc%])\$if($and(%albumartist%,%album%,%title%),['['$num(%tracknumber%,2)']']  %artist% - %title%,$num(%_diskwriter_index%,3)  %_filename%)

for albums to be diskwritten in a usable fashion (or else there will be a separate folder for each artist).
So I'm just wondering whether it's possible to make a string that would merge the functionality of all these into one string, so that I will not have to change between them. Or maybe an even smoother solution to the problem? I guess it's doable, but I just can't figure it out, so any help would be greatly appreciated.



[Edit: Language]
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

Diskwriter output file name formatting

Reply #11
No bites...? 
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

Diskwriter output file name formatting

Reply #12
Try:
Code: [Select]
$if($and(%artist%,%album%,%title%),%artist%,$if($and(%album artist%,%album%,%title%),%album artist%,$if($and(%albumartist%,%album%,%title%),%albumartist%)))\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%),%album% ['('%date%')'])\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%),[disk %disc%])\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%),['['$num(%tracknumber%,2)']']  %title%,$num(%_diskwriter_index%,3)  %_filename%)

Diskwriter output file name formatting

Reply #13
Thanks for quick response!    But, alas! --- sorry, it still writes individual folders for each artist on VA album (like: "F:\Music\Bongo Herman\400% Dynamite (2000)\ [01]  Chairman Of The Board.mpc").
What I'm picturing getting into one string is something like (say e.g "F:\Music" is specified outputfolder):

1) For "normal" albums with tagfields %artist%, %album%, %tracknumber% & %title% checked, a structure like this:
"F:\Music\Autechre\Chiastic Slide (1997)\[01]  Cipater.mpc"
(or "\Miles Davis\Bitches Brew (1969)\disk 1\[01]  Pharaoh's Dance.mpc" in a box set.)

2) For "VA" albums with tagfields %artist%, %album%, %tracknumber%, %title% & %albumartist% OR %album artist% checked (e.g %albumartist% = 'Various'), a structure like this:
"F:\Music\Various\400% Dynamite (2000)\[01]  Bongo Herman - Chairman Of The Board.mpc"

3) For files without tagfields %artist% (AND/OR %albumartist% AND/OR %album artist%) AND %album% AND %title%, let's say an untagged file "Primitive.wav"), a structure like this:
"F:\Music\001  Primitive.mpc"

It's not easy for a newbie this...... 
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

Diskwriter output file name formatting

Reply #14
Sorry, I misread your question.
I'll try to figure out (if I find time and no one has provided a solution).

Diskwriter output file name formatting

Reply #15
I'm grateful, man! 
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

Diskwriter output file name formatting

Reply #16
I hope it works this time:
Code: [Select]
$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%,%tracknumber%),$if2(%albumlist%,$if2(%album list%,%artist%)))\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%,%tracknumber%),%album% ['('%date%')'])\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%,%tracknumber%),[disk %disc%])\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%,%tracknumber%),'['$num(%tracknumber%,2)']' $if($or(%album artist%,%albumartist%),%artist%) - %title%,$num(%_diskwriter_index%,3) %_filename%)

Diskwriter output file name formatting

Reply #17
We're sure getting closer, but I still get this structure:
"F:\Music\Hawkwind\Space Box; 1970 & Beyond (Space, Krautrock & Acid Trips)  (1996)\disk 1\[01] Hawkwind - Valium 10 (12' Version).mpc"
when I would like:
"F:\Music\Various\Space Box; 1970 & Beyond (Space, Krautrock & Acid Trips) (1996)\disk 1\[01]  Hawkwind - Valium 10 (12' Version).mpc"
The file has %artist% field "Hawkwind" and %albumartist% field "Various".
Point is: If fields %albumartist% or %album artist% is present, these should be chosen as directoryname for first directory in hierachy, and field %artist% should be ignored. Field %artist% should then only be present in filename, to which it should be added. On the other hand, on normal albums the %artist% field should not be added to filename. You're string returned this structure on normal album :
"F:\Music\Autechre\Chiastic Slide (1997)\[01]  - Cipater.mpc"
Which is great.
(Only; if I should be a real pain-in-the-ass nitpicking bastard, in a perfect world I would prefer:
"F:\Music\Autechre\Chiastic Slide (1997)\[01]  Cipater.mpc")
 
For untagged file "Cichli.wav" it returned:
"F:\Music\001 Cichli.mpc"
Which is perfect.

What should have been a feature in foobar2000 is maybe what you get in EAC: The possibility of choosing one diskwriting string for "VA" albums and another for all other kinds. (And that it automagically switches between those, ofcourse...)

Ofcourse I can just change string according to album type, but it would have been very neat to have it all in just one string once and for all......

Sorry for being such a b***h... 
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

Diskwriter output file name formatting

Reply #18
Code: [Select]
$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%,%tracknumber%),$if($or(%album artist%,%albumartist%),$if2(%album artist%,%albumartist%),%artist%))\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%,%tracknumber%),%album% ['('%date%')'])\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%,%tracknumber%),[disk %disc%])\$if($and($or(%artist%,%album artist%,%albumartist%),%album%,%title%,%tracknumber%),'['$num(%tracknumber%,2)']'$if($or(%album artist%,%albumartist%), %artist% -) %title%,$num(%_diskwriter_index%,3) %_filename%)


For a "normal album", you should now have:
"F:\Music\Autechre\Chiastic Slide (1997)\[01] Cipater.mpc"

I am not really sure about the first folder of the structure. Just try.

Diskwriter output file name formatting

Reply #19
Works! 
You rock, dude!
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

 
SimplePortal 1.0.0 RC1 © 2008-2019