From 218ffdb3b3df245f1761f1e4889b222e2e52a488 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Mon, 10 Aug 2020 16:10:35 +0200 Subject: [PATCH] classical_extras: Picard 2.4 compatibility config.setting["preserved_tags"] is now a proper list --- plugins/classical_extras/__init__.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/classical_extras/__init__.py b/plugins/classical_extras/__init__.py index 45bca9f8..4dd36032 100644 --- a/plugins/classical_extras/__init__.py +++ b/plugins/classical_extras/__init__.py @@ -81,8 +81,8 @@ # # The main control routine is at the end of the module -PLUGIN_VERSION = '2.0.11' -PLUGIN_API_VERSIONS = ["2.0", "2.1", "2.2", "2.3"] +PLUGIN_VERSION = '2.0.12' +PLUGIN_API_VERSIONS = ["2.0", "2.1", "2.2", "2.3", "2.4"] PLUGIN_LICENSE = "GPL-2.0" PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html" @@ -118,7 +118,6 @@ ########################## # CONSTANTS # N.B. Constants with long definitions are set in const.py -PRESERVE = [x.strip() for x in config.setting["preserved_tags"].split(',')] DATE_SEP = '-' # COMMONLY USED REGEX @@ -598,6 +597,13 @@ def get_references_from_file(release_id, path, filename): # OPTIONS +def get_preserved_tags(): + preserved = config.setting["preserved_tags"] + if isinstance(preserved, str): + preserved = [x.strip() for x in preserved.split(',')] + return preserved + + def get_options(release_id, album, track): """ Get the saved options from a release and use them according to flags set on the "advanced" tab @@ -918,7 +924,7 @@ def get_options(release_id, album, track): orig_metadata['genre']) if options['cwp_genre_tag'] and options['cwp_genre_tag'] in orig_metadata: keep_list.append(options['cwp_genre_tag']) - really_keep_list = PRESERVE[:] + really_keep_list = get_preserved_tags()[:] really_keep_list.append( options['cwp_options_tag'] + ':workparts_options')