Chaser
Jun 11 2006, 12:50
$if(%album artist%,VA,%artist%) - [%disc%-]%tracknumber% - $if(%album artist%,%artist% - )%title%
This string is not working for me in "Rename, move or copy files".
I'd like to have a leading "VA" if the tag %album artist% exists. How can I achieve this?
Thank you for your help. I bet it is very easy!
Russell777
Jun 11 2006, 12:54
QUOTE(Chaser @ Jun 11 2006, 20:50)

$if(%album artist%,VA,%artist%) - [%disc%-]%tracknumber% - $if(%album artist%,%artist% - )%title%
This string is not working for me in "Rename, move or copy files".
I'd like to have a leading "VA" if the tag %album artist% exists. How can I achieve this?
Thank you for your help. I bet it is very easy!

I believe this will do it
$if(%album artist%,'VA'[-%artist%],%artist%) - [%disc%-]%tracknumber% [-%title%]
Chaser
Jun 11 2006, 12:56
No, unfortunatelly it isn't working either.
edit:
It seems as if $if(%album artist%,'VA'[-%artist%],%artist%) doesn't evaluate to false, if the tag %album artist% is not present.
http://wiki.hydrogenaudio.org/index.php?ti...ormat_Reference was no help for me
Russell777
Jun 11 2006, 13:00
QUOTE(Chaser @ Jun 11 2006, 20:56)

No, unfortunatelly it isn't working either.
edit:
It seems as if $if(%album artist%,'VA'[-%artist%],%artist%) doesn't evaluate to false, if the tag %album artist% is not present.
http://wiki.hydrogenaudio.org/index.php?ti...ormat_Reference was no help for me

I've just changed it a bit try again,i don't have albums with various artists so cannot test it
$ifequal($meta(album artist),$meta(artist),%artist%,'VA-'%artist%) (Should work now)
Erich w/ an h
Jun 11 2006, 13:04
your second $if statement doesnt have an else statement, did you mean to use $if2?
try this, see if it works:
$if($meta(album artist),VA,$meta(artist)) - [%disc%-]%tracknumber% - $if2($meta(album artist),$meta(artist) - )%title%
Chaser
Jun 11 2006, 16:22
It's not working completly, since the third meta finds the artist-tag:
%album artist%
Defined as $if3($meta(album artist),$meta(artist),$meta(composer),$meta(performer)).
(quote from wiki)
Isn't it possible to directly check the existence of a tag?
foosion
Jun 11 2006, 16:43
QUOTE(Chaser @ Jun 12 2006, 00:22)

Isn't it possible to directly check the existence of a tag?
Use $meta_test(artist) to check for the presence of the artist tag, and $meta(artist) to access its value.
Bachi-Bouzouk
Jun 11 2006, 16:44
$if(%track artist%,VA,%artist%) - [%disc%-]%tracknumber% - $if(%track artist%,%artist% - )%title%
test it
tool++
Jun 11 2006, 17:04
spaces + % = wont work.
if it has spaces, I've found I have to use $meta_test() and $meta()
My main problem at the moment is actually finding a place for the album (album, date, genre) when you use your primary column to display track artists, if existant >.<
Currently I'm using a botched solution that looks ok.
E: Ok can you set using something like $meta()?
foosion
Jun 11 2006, 17:10
Field names with spaces work just fine here. Where do you have problems with that?
tool++
Jun 11 2006, 17:23
Pretty much everywhere. If statements :/
foosion
Jun 11 2006, 17:40
Are you sure it is not a problem with remapped fields?
Chaser
Jun 12 2006, 13:17
Thank you foosion! You gave the missing hint!
Isn't $meta_test(TAG) missleading? Since $meta(TAG) would return the "second match", if the first remapping doesn't match.
So I thought, that $meta_test(album artist) would also return TRUE, if %album artist% is inexistent, however %artist% exists.
Would renaming it to $TAG_test() make sense?
Moreover we maybe should edit the wiki to "1 (aquivilent to TRUE)" (for those, who don't know any programming).
Finally this is the TAGZ-script which seems to do it's job:
$if($meta_test(album artist),VA,%artist%) - [%disc%-][%tracknumber% - ]$if($meta_test(album artist),%artist% - )%title%
QUOTE(Chaser @ Jun 12 2006, 15:17)

Since $meta(TAG) would return the "second match", if the first remapping doesn't match.
$meta(name) does not use remapping
foosion
Jun 12 2006, 19:23
QUOTE(Chaser @ Jun 12 2006, 21:17)

Moreover we maybe should edit the wiki to "1 (aquivilent to TRUE)" (for those, who don't know any programming).
The string "1" is not equivalent to true in titleformatting scripts. If the field exists, $meta_test returns the string value "1"
and the boolean value true, but only the boolean value counts for boolean function and control flow constructs.
Chaser
Jun 12 2006, 23:40
foosion, oh, I didn't know that! I always thought, that methods are capable of giving back one variable (may be this is different in C). And if not there could be 1 returned and treated as TRUE... So it's ok for me either way.
But as you see I had some problems myself fiddling this out with the wiki
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.