X-Git-Url: https://git.draconx.ca/gitweb/picard-plugins.git/blobdiff_plain/fe11a0cdc06bd11086ae58ce64757f87168269e0..4712c6feea4ab43b26956c35338a2b0038a17b6c:/karaoke-flagger.py?ds=sidebyside diff --git a/karaoke-flagger.py b/karaoke-flagger.py index 13abe78..11c327e 100644 --- a/karaoke-flagger.py +++ b/karaoke-flagger.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright © 2019 Nick Bowler +# Copyright © 2019-2020 Nick Bowler # # License GPLv3+: GNU General Public License version 3 or any later version. # This is free software: you are free to change and redistribute it. @@ -17,7 +17,7 @@ karaoke tracks, and left unset otherwise. So a tagger script might use $if(%_karaoke%,$set(comment:karaoke,%_karaoke%)), for example, to embed that into the file's comment tag.

''' -PLUGIN_VERSION = "0" +PLUGIN_VERSION = "1" PLUGIN_API_VERSIONS = ["2.0"] PLUGIN_LICENSE = "GPL-3.0-or-later" @@ -28,7 +28,9 @@ def modulename(): return modulename.__module__[len("picard.plugins."):] def add_metadata(tagger, metadata, track, release): - for r in track["recording"]["relations"]: + # for stanadlone recordings, "track" is actually a recording, not a track + recording = track.get("recording", track) + for r in recording["relations"]: # 'karaoke version of' is the backward relation of this type... if r["type-id"] != "39a08d0e-26e4-44fb-ae19-906f5fe9435d": continue