question regarding $if behavior in export (v2.41)


#1

in my mte file I have this

$put(x,%artist%)
$if($strcmp($get(x),Various Artists),$put(x,hhhhhh),not equal)
$get(x)

$put(x,%artist%)
$if($eql($get(x),Various Artists),$put(x,hhhhhh),not equal)
$get(x)

in my output html file I have this

10,000 Maniacs
not equal
hhhhhh

10,000 Maniacs
not equal
hhhhhh

Is this the expected behavior of $if()


#2

$put() cannot be an argument within another Mp3tag function call.
You have to change the expression to something like this:
$put(x,$if(condition,yes-case,no-case))

DD.20080509.1906.CEST


#3

just tried this

$put(x,%artist%)
$if($jjjjjjjjjj($get(x),Various Artists),$put(x,hhhhhh)equal,not equal)
$get(x)

and got the same behavior so apparently neither $if nor $strcmp are supported in export environment?

Where is this stuff documented?


#4

mp3me, I have found $put just fails to work in certain scripting contexts. I've coded around the need to use it wherever possible.

Nowhere I've found. The best available is the incomplete Help, Mp3tag usage, Scripting functions .


#5

You could try the following, or some variation of it that applies to what you want.
When dealing with "Various Artists" I use "Various Artists: Genre" in %band% (Album Artist) and the artists playing the song in %artist%
So, when using this, I just compare whether the first 7 letters of %band% are equal to "Various" or not, and if so, I use that field. Otherwise, I use %artist%

Various - Year Y - Album X
or
Artist - Year Y - Album X

$filename(txt)$loop(%album%,1)
$if($eql($left(%band%,7),Various),%band%|%year%|%album%,%artist%|%year%|%album%)
$loopend()