Bug with picard script, some muti disc releases going into mutidisc disc 1, disc 2 ect folders, the way they should and others not

Hi there,

I have a pretty bizarre issue that I am unable to solve. I have added a part in my tagger script which is meant to state that if a release is a multi-disc cd such as the Fatboy slim collection, then put tracks into disc 1, disc 2 etc folders. However, for this album, Picard wants to put all the tracks into 1 album folder. but other releases such as Anjunabeats, Volume 10 the script works fine. as you can see from the below screenshot.

This is my rename script here Rename script - Pastebin.com Any ideas on what on earth is happening? Please?

How are you setting the %_discfolder% variable?

Ah I thank its to do with disabling some of the tagger scripts.

this is for adding total discs,
$if($gt(%totaldiscs%,1),$set(_discfolder, Disc %discnumber%))

Setting original year
$set(_date,$left($if2(%originalyear%,%date%),4))

Adding source
// add source info $if($eq_any(%media%,Compact Disc,Copy Control CD,Data CD,DTS CD,Enhanced CD,HDCD,8cm CD,Blu-spec CD,SHM-CD,HQCD,CD+G,8cm CD+G,CD),$set(_source,CD)) $if($eq_any(%media%,7" Vinyl,10" Vinyl,12" Vinyl,Flexi-disc,7" Flexi-disc),$set(_source,Vinyl)) $if($eq_any(%media%,DVD-Audio,DVD-Video),$set(_source,DVD)) $if($eq_any(%media%,Hybrid SACD,Hybrid SACD \(CD layer\),Hybrid SACD \(SACD layer\),SHM-SACD),$set(_source,SACD)) $if($eq(%media%,Digital Media),$set(_source,WEB)) $if($and($not(%_source%),$ne(%media%,Unknown Format)),$set(_source,%media%))

various albums into various artists folder
$if($eq(%albumartist%,Various),$set(_subfolder,Various Artists))

So how could I add these scripts into my renaming script? so that it’s more streamlined? I mean what is the difference between the rename and tagger?

It would look like I would need to consolidate this part into one.

$noop(For multidisc albums add a subfolder such as Disc 1, Disc 2 ect, except for vinyl.) $if($gt(%totaldiscs%,1),$set(_discfolder, Disc %discnumber%)) $if($and(%_discfolder%,$not($in(%media%,Vinyl))),%_discfolder%/)

This is explained in the Scripts section of the documentation.

As for streamlining, I would move into my file naming script any scripts that set variables (starting with an underscore) that you always want to run and are not dependencies of a tagging script that sets a tag value. That’s just my personal preference, and is not strictly necessary, but it does make debugging a bit easier because it puts everything in one place. I also make extensive use of the “View script variables” plugin when trying to debug a script.

thank you,

Iam working on doing that myself. For instance, the bit code that sets mutidisc except for vinyl,

$noop(For multidisc albums add a subfolder such as Disc 1, Disc 2 ect, except for vinyl.) $if($gt(%totaldiscs%,1),$set(_discfolder, Disc %discnumber%)) $if($and(%_discfolder%,$not($in(%media%,Vinyl))),%_discfolder%/)

I wonder if I could put that into one $if line? or is this as small as i could get? maybe?

Something like:

$noop(Add disc subfolders for multi-disc sets, except vinyl)
$if($and($gt(%totaldiscs%,1),$not($in(%media%,Vinyl))),Disc %discnumber%/)

yeah, that seems to work thank you.

I now trying to work on adding a source tag. The code I had before used to work. but doesn’t seem to want to work anymore. Scripts are all enabled and working. but I’m not seeing a source field appear. I have tried $set and $add as well as making sure I have percentages etc. but has stopped working.

Can you share the script you use to set the source tag?

this is what I have,

$if($not(%_source%),

    $if($eq_any(%media%,Compact Disc,Copy Control CD,Data CD,DTS CD,Enhanced CD,HDCD,8cm CD,Blu-spec CD,SHM-CD,HQCD,CD+G,8cm CD+G,CD),$set(%source%,CD))

    $if($eq_any(%media%,7" Vinyl,10" Vinyl,12" Vinyl,Flexi-disc,7" Flexi-disc,Vinyl),$set(%source%,Vinyl))

    $if($eq_any(%media%,DVD-Audio,DVD-Video),$set(%source%,DVD))

    $if($eq_any(%media%,Hybrid SACD,Hybrid SACD (CD layer),Hybrid SACD (SACD layer),SHM-SACD),$set(%source%,SACD))

    $if($eq_any(%media%,Digital Media),$set(%source%,Web))

    $if($and($not(%source%),$ne(%media%,Unknown Format)),$set(%source%,Unknown Web)))

I dont know if I need to then refresh or click run script and select the script to use?

The first line checks for %_source% with an underscore, should be likely this instead:

$if($not(%source%),
1 Like

I have tried that, and no difference.

.

I have tried a previous config of Picard and still same issue.

What’s the value for media in this example?

1 Like

for the screenshot, it’s simply Vinyl

Ah, now I see it. Sorry, am on mobile only and sometimes miss the details.

Don’t put percent signs around the variable name you want to set with $set. The correct syntax is $set(source,…)

1 Like

Thank you. Somehow it has decided to seemingly work. Dono why, but I’m not sure if I could just right click run script to check,or just refresh, or re-import. But even though i tried that before, it didn’t work. but has now decided to work (for now).

Iam trying to work on a quality tag. dono if there is such a thing.

$if($eq_any(%bitrate%,128),$set(quality,Fair)
$if($eq_any(%bitrate%,160),$set(quality,Good)
$if($eq_any(%media%,cd),$set(quality,Very Good)
$if($eq_any(%frequency%,44100),$set(quality,Very Good)
$if($eq_any(%bitrate%,24),$set(quality,Excellent)
$if($eq_any(%media%,vinyl),$set(quality,Excellent)))))))

I don’t know here I have the same issue, as it is basically similar to the set source option I had?

thoughts?

For the media comparison make sure you use the proper casing, equality checks are case sensitive. So it’s CD, not cd, and Vinyl, not vinyl.

For the bitrate you’d usually use $eq, not $eq_any because this is not multi-value.

But the actual reason is that you need to compare against 128.0, not 128. See e.g.

3 Likes