Help with an old script


#1

Hi everyone,
This Community helped me a few years ago with a script that has worked flawlessly for me. Today I just updated Picard and my script no longer works.

I’m getting am "Unknown function ‘aggregate_bitrate’ error in my File Renaming Script. Not sure how to fix this and was hoping someone can point me in the right direction.

what I’m trying to do is just average the bitrates and add to my folder renaming. I’ve read through some posts already but was a little confused as to how to incorporate some of the scriptings into mine.

here is my script:

$set(album,$replace(%album%,:, -))

$if($lt($matchedtracks( ),$div(%_totalalbumtracks%,2)),Misc,

$if($inmulti(%albumgrouping%,Comedy),Comedy,

$if($inmulti(%genre%,Comedy),Comedy,

$if($inmulti(%genre%,Humour),Comedy,

$if($rsearch(%genre%,Christmas),Holidays,

$if($rsearch(%album%,Comedy),Comedy,

$if($rsearch(%album%,Christmas),Holidays,

$if($rsearch(%album%,Santa ),Holidays,

$if($rsearch(%album%,Holidays),Holidays,

$if($rsearch(%genre%,AudioBook),AudioBooks,

$if($inmulti(%genre%,Holidays),Holidays,

$if($inmulti(%releasetype%,soundtrack),Soundtrack,

$if($eq(%albumartist%,Various Artists),Various Artists,

$if($eq($left($if2(%albumartist%,%artist%),4),The ),

$left($right($if2(%albumartist%,%artist%),$sub($len($if2(%albumartist%,%artist%)),4)),1),

$left($if2(%albumartist%,%artist%),1)))))))))))))))

/

$if($inmulti(%releasetype%,soundtrack),(Soundtrack)

  • %album%

$if($gt(%totaldiscs%,1),(CD%discnumber%))

($left(%date%,4))$left([$aggregate_bitrate(majority),4)],

$rreplace($if2(%albumartist%,%artist%),(^The )(.*),\2, The) -

$if($ne(%albumartist%,Various Artists),($left(%originaldate%,4)) )%album%

$if($gt(%totaldiscs%,1), (CD%discnumber%))

$if($ne(%date%,%originaldate%),($left(%date%,4)

$if($and($eq(%albumartist%,Various Artists),$eq(%originaldate%,%date%)),(%date%)))

$left([$aggregate_bitrate(majority),4) %totaltracks% tks]

$if($lt($matchedtracks( ),%_totalalbumtracks%), (~Inc. - $matchedtracks( ) of %_totalalbumtracks%)))

/

$num(%tracknumber%,2). %artist% - %title%

thanks in advance!


#2

Looks like you had a plugin which provided the $aggregate_bitrate (that’s no standard function). With Picard 2 this plugin needs to be updated to be compatible.

In the best case that just means updating the API version. Find the plugin file in your plugin folder and open it with a text editor. Find the line that starts with PLUGIN_API_VERSIONS and change it to

PLUGIN_API_VERSIONS = ["2.0", "2.1"]

Restart Picard and see whether you can see and activate the plugin in options.

If this does not work post the plugin here and we can help updating it.


#3

thank you for your reply! I have no idea which plug in that would be. i’ll keep searching. do you know if there is anyway to search posts from the old forums?

thanks again for the reply. hopefully i can track down the plug in.