Length of Disc/Album

I did a search for this topic but only found one relevant post but no answer.
I would like to calculate the total length of each disc and save that information to a metatag field. I see the figure is already calculated when a release is matched, but have no idea how to retrieve that info and place it in a field such as disclength. Also, would I need to run a tagging script first, before I can use that in a file renaming script?

This is sort of done as one of the examples for my Persistent Variables plugin. This plugin is one of the “official” ones listed and available for installation from Picard’s Plugin Options settings page.


This is awesome. Exactly what I was looking for.

1 Like

In the examples link is the script for calculating the Disc and Release playing time. It has the following code.
$set(Disc Playing Time,%_temp%)
$set(Release Playing Time,%_temp%)

I’m trying to use these variables but I get a script error that says unexpected character ’ ’ (i.e. the blank space in the variable name). Is the only way to use these fields to change the example script to either remove the blanks or replace them with an underscore such as ReleasePlayingTime or Release_Playing_Time ?

Nope, you can still access them using the $get() function as $get(Disc Playing Time) and $get(Release Playing Time). You just can’t access them using the %variable_name% shortcut because they contain spaces. Of course, you could also remove or replace the spaces in the $set() functions so you can use the %variable_name% shortcut, but this will also change the way they are displayed in the metadata.