I'm putting together some export scripts and I'm struggling at one particular point:
Albumartist vs. Artist.
Case 1: There is a sampler album, in which there might be or not an album artist (e.g. Various Artists) and given for each track a separate artist. Then the artist of each track in the exported file should be different.
Case 2: There is one album of one artist (and the same as album artist, or none) in which case the artist in the exported file should obviously be this very artist.
I wanted to have one universal script which handles all of this, because I don't know or don't want to care of the above possibilities.
In the header of the export file I want to see the artist or, if it's a sampler, VA.
$if(%albumartist%,$if($eql(%albumartist%,%artist%),%artist%,'VA'),%artist%)
i.e.:
$if(
%albumartist%
, $if(
$eql(%albumartist%,%artist%)
, %artist%
,' VA'
)
, %artist%
)
This works just fine.
For the track listing part my approach so far was an if-loop as similar.
Notice: the structure of the if-loop is the same as the above.
I'm using a $loop(%_filename_ext%) here.
$if(%albumartist%,$if($eql(%albumartist%,%artist%),$puts(at,%title%),$puts(at,%artist%: %title%)),$puts(at,%title%))
i.e.
$if(
%albumartist%
, $if
(
$eql(%albumartist%,%artist%)
, $puts(at,%title%)
, $puts(at,%artist%: %title%)
)
, $puts(at,%title%)
)
which I believe means I get variable 'at' either containing only 'title' or 'artist: title'.
I'd then use this variable 'at' further in the script.
Problem is: It doesn't work this way and I can't figure out what's wrong with my script.
It doesn't work either when I put the fieldnames in instead of the $puts().
To compare this I give too examples:
File 1 tags:
Track: 8
Title: Summer
Artist: Calvin Harris
Albumartist: Various (could also be none)
Length: 03:45
Exports as:
08 - Summer ..................... 03:45
Should be:
08 - Calvin Harris: Summer ...... 03:45
File 2 tags:
Track: 8
Title: The Lily
Artist: Layla Zoe
Albumartist: none (could also be 'Layla Zoe')
Exports as:
08 - The Lily ................... 10:11
This one's right.
I'd highly appreciate if someone could look at this and point me into the right direction.
As reward I might post the final working export script 