Trying to write a script that will set a tag %discversion% based on 2 existing tags, %media%, written by Picard, which may have the value “CD”, and %discogs_format%, written by the discogs component in Foobar, which may contain one or both partial strings “Remaster” or “Reissue” (example string: 1 x CD, Album, Limited Edition, Numbered, Reissue, Remaster). If %media% contains the string “CD”, I want the script to set %discversion% to “Remaster” if %discogs_format% contains that string, “Reissue” if it contains that string but not Remaster, or “1st” if it contains neither. After wracking my brain for most of the afternoon the final script I’ve tried is this:
$if($rsearch(%media%,CD),$if2($if($rsearch(%discogs_format%,Remaster),$set(discversion,Remaster)),$if($rsearch(%discogs_format%,Reissue),$set(discversion,Reissue)),$set(discversion,1st)))
That doesn’t work. I thought maybe the underscore in %discogs_format% was problematic so I tried removing it and that didn’t help. Maybe I’m using $rsearch wrong? Any help would be appreciated.