Hi,
I’ trying to figure out how to move my albums with duplicates to a separate folder, but somehow this doesn’t work:
$if($gt($matchedtracks( ),%_totalalbumtracks%),DuPS/)
So, i have something like:
How do i get the number of files i have in a disc? (In this case; the 16?)
Is there a doc where we can find all functions and variables available for scripting?
Thank you
Actually not sure how what you want can be done. $matchedtracks()
will AFAIK match the number of tracks, not files, that have at least one file matched, so in your case it will be 11. What you actually want is to know whether a) all files have matches, $eq($matchedtracks(),%_totalalbumtracks%)
, and b) whether there are more files matched to the release than there are tracks. I am not sure about an existing function that would allow you to do b), but it shouldn’t be hard to implement as a plugin.
Documentation is available on the Picard website for scripting and variables.
i found $is_complete() on older musicbrainz forums, but it no longer works.
i’m actually using a), with $neq() for incomplete releases.
View script variables shows additional variables available for single files. Too bad it doesn’t work for the entire Album.
Thank you for your feedback.
As far as I remember $is_complete()
was part of some plugin, but your solution is the proper solution for this with the current functionality available by default.
Just figured out that my solution, doesn’t work.
Releases with video/data tracks can be complete without $eq($matchedtracks(),%_totalalbumtracks%) being true.
I guess i’m stuck on this one.
Obviously my memory betrayed me a bit, $is_complete was integrated into Picard, and it was me who actually did that . Please try that function in latest Picard 1.4 development version available from the download page.
It should do what you want: Do not report a release as complete if there are duplicates and it can ignore certain track types ( pregap, video, silence and data tracks, you can choose which should be ignored in the options).
3 Likes
great!
can you tell me the arguments for the function, or where to find it?
thank you so much.
just found your ticket on it!
https://tickets.musicbrainz.org/browse/PICARD-514
following your links:
going to give a look at your code now! (feel a bit lost…)
thank you so much!
As i see it,
def func_is_complete(parser):
if parser.file:
if parser.file.parent and parser.file.parent.album.is_complete():
return "1"
return "0"
takes no args, and returns just true or false (0,1), right?
And if i undestood it right, this is what i need:
$if($eq($is_complete(),0),
$if($lt($matchedtracks( ),%_totalalbumtracks%), _inComplete/, _DuPs/)
)
moving duplicates to the _DuPS folder, incomplete albums to the _inComplete folder and complete ones on my destination root…
Thanks once again.
1 Like