$stricmp limitation, Mp3tag bug, or am I just an idiot?


#1

The code (stripped down to a minimum to make it easier to understand):

$loop(%_parent_directory%)\b\ul\caps %albumartist% \b0\ul0\caps0\par
$if($stricmp(%albumartist%,%artist%),
\b Genres: \b0 $meta(genre)\par,)
\par
$loop(%_directory%)\tab\b\ul %album% \b0\ul0 \par
\tab\b Year: \b0 %year% \tab\b  Date: \b0 %date%\par
\par
$if($stricmp(%albumartist%,%artist%),,$loop($if2(%artistsort%,%artist%),1)\tab\tab\b\ul\caps %artist% \b0\ul0\caps0\par
\tab\tab\b Genres: \b0 $meta(genre)\par
\par
$loopend())$loopend()$loopend()
\par

which I think should give me this when the Album Artist tag and all Artist tags are the same:

ALBUM ARTIST
Genre: genre

Album Year: year Date: date
but this when they differ:

ALBUM ARTIST

Album Year: year Date: date
ARTIST 1 Genre: genre ARTIST 2 Genre: genre ARTIST 3, etc Genre: genre

The problem is that on some albums only one track has an artist tag which differs from the album artist tag. I want the script to show the artists below those albums as in example #2. My script is exporting them as example #1 instead. How do I get the script to notice there's a different artist tag in one track?

I think possibly the script is applying the same conditions from the first ALBUM folder to all subsequent ALBUM (%_directory%) folders it finds within the ALBUMARTIST (%_parent_directory%) folder. How do I get it to evaluate albums individually and thus not skip tracks?

I should point out that the skipped tracks do contain the album artist in the artist tag along with one other artist or more. The format for these artist tags is "ARTIST1 / ARTIST2" which is the format foobar now uses. More often than not, one of the artists is the same as the album artist tag, which makes me think my problem could be a limitation of the $stricmp function (which I haven't encountered before in foobar) or a bug in Mp3tag.

My script is doing what I want it to on "Various Artists" albums and albums where none of the artist tags match the album artist tag, i.e. exporting them as in example #2.


#2
QUOTE (Hobnob @ Aug 26 2011, 06:57) <{POST_SNAPBACK}>
The code (stripped down to a minimum to make it easier to understand):
$loop(%_parent_directory%)\b\ul\caps %albumartist% \b0\ul0\caps0\par
$if($stricmp(%albumartist%,%artist%),
\b Genres: \b0 $meta(genre)\par,)
\par
$loop(%_directory%)\tab\b\ul %album% \b0\ul0 \par
\tab\b Year: \b0 %year% \tab\b  Date: \b0 %date%\par
\par
$if($stricmp(%albumartist%,%artist%),,$loop($if2(%artistsort%,%artist%),1)\tab\tab\b\ul\caps %artist% \b0\ul0\caps0\par
\tab\tab\b Genres: \b0 $meta(genre)\par
\par
$loopend())$loopend()$loopend()
\par<!--QuoteEnd--></div><!--QuoteEEnd--> 

Please study the Mp3tag help manual, sections Scripting and Export.
There is no function $stricmp in the Mp3tag scripting language.

Use an editor, which provides syntax colorizing for the Mp3tag Scripting language, and try to code the export script this way ...

$loop(%_parent_directory%)'\b\ul\caps '%ALBUMARTIST%' \b0\ul0\caps0\par' $if($eql(%ALBUMARTIST%,%ARTIST%), '\b Genres: \b0 '$meta(genre)'\par',) '\par' $loop(%_directory%)'\tab\b\ul '%ALBUM%' \b0\ul0 \par' '\tab\b Year: \b0 '%YEAR%' \tab\b Date: \b0 '%DATE%'\par' '\par' $if($eql(%ALBUMARTIST%,%ARTIST%),,$loop($if2(%ARTISTSORT%,%ARTIST%),1)'\tab\tab\b\ul\caps '%ARTIST%' \b0\ul0\caps0\par' '\tab\tab\b Genres: \b0 '$meta(genre)'\par' '\par' $loopend())$loopend()$loopend() '\par'

$loop(%_parent_directory%)'\b\ul\caps '%albumartist%' \b0\ul0\caps0\par'
$if($eql(%albumartist%,%artist%),'\b Genres: \b0 '$meta(genre)'\par',)
'\par'
$loop(%_directory%)'\tab\b\ul '%album%' \b0\ul0 \par'
'\tab\b Year: \b0 '%year%' \tab\b  Date: \b0 '%date%'\par'
'\par'
$if($eql(%albumartist%,%artist%),,$loop($if2(%artistsort%,%artist%),1)'\tab\tab\b\ul\caps '%artist%' \b0\ul0\caps0\par'
'\tab\tab\b Genres: \b0 '$meta(genre)'\par'
'\par'
$loopend())$loopend()$loopend()
'\par'

Be aware that you do not embedd foreign scripting code fragments into the Mp3tag Scripting Language, but you write a Mp3tag Export Script in this way, that it creates a textfile, which is written in fully foreign scripting language code.

DD.20110826.0922.CEST

Note from Mp3tag changelog:
[2014-12-06] NEW: added scripting function $strcmp to compare strings case-sensitively.
[2014-12-06] NEW: added scripting function $stricmp to compare strings case-insensitively.

DD.20160319.1932.CET