When standalone recordings are loaded into Picard, the "track" metadata
processor is called with a "track" parameter that is not actually a
track at all, but a recording.
We actually only care about the recording so assume it is the recording
if it lacks the "recording" key.
# -*- coding: utf-8 -*-
#
# -*- 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.
#
# License GPLv3+: GNU General Public License version 3 or any later version.
# This is free software: you are free to change and redistribute it.
<code>$if(%_karaoke%,$set(comment:karaoke,%_karaoke%))</code>, for example,
to embed that into the file's comment tag.</p>
'''
<code>$if(%_karaoke%,$set(comment:karaoke,%_karaoke%))</code>, for example,
to embed that into the file's comment tag.</p>
'''
PLUGIN_API_VERSIONS = ["2.0"]
PLUGIN_LICENSE = "GPL-3.0-or-later"
PLUGIN_API_VERSIONS = ["2.0"]
PLUGIN_LICENSE = "GPL-3.0-or-later"
return modulename.__module__[len("picard.plugins."):]
def add_metadata(tagger, metadata, track, release):
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
# 'karaoke version of' is the backward relation of this type...
if r["type-id"] != "39a08d0e-26e4-44fb-ae19-906f5fe9435d":
continue