From fe64b49165a9fd53dfa49d0c1bb63a3a0b9957fb Mon Sep 17 00:00:00 2001 From: Sophist Date: Thu, 16 Oct 2014 16:32:49 +0100 Subject: [PATCH] Allow $matchedtracks any number of args ... ... like $noop. And note that $matchedtracks works only in file naming scripts (which makes sense). --- picard/script.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/picard/script.py b/picard/script.py index 31ebf148d..33638f84e 100644 --- a/picard/script.py +++ b/picard/script.py @@ -706,7 +706,8 @@ def func_performer(parser, pattern="", join=", "): return join.join(values) -def func_matchedtracks(parser, arg): +def func_matchedtracks(parser, *args): + # only works in file naming scripts, always returns zero in tagging scripts if parser.file and parser.file.parent: return str(parser.file.parent.album.get_num_matched_tracks()) return "0" @@ -922,7 +923,7 @@ register_script_function(func_copymerge, "copymerge") register_script_function(func_len, "len") register_script_function(func_lenmulti, "lenmulti", eval_args=False) register_script_function(func_performer, "performer") -register_script_function(func_matchedtracks, "matchedtracks") +register_script_function(func_matchedtracks, "matchedtracks", eval_args=False) register_script_function(func_is_complete, "is_complete") register_script_function(func_firstalphachar, "firstalphachar") register_script_function(func_initials, "initials")