From 85f65e30374d4a4940c272d31cbc78ca5fcb169c Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Mon, 15 Mar 2021 13:00:12 +0000 Subject: [PATCH] AcousticBrainz Mood-Genre Save existing genre metadata (i.e. MB genres if "Use genres from MusicBrainz" is enabled) so that scripts can put it back or merge genre values. --- plugins/acousticbrainz/acousticbrainz.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/acousticbrainz/acousticbrainz.py b/plugins/acousticbrainz/acousticbrainz.py index f4db0999..af6372b2 100644 --- a/plugins/acousticbrainz/acousticbrainz.py +++ b/plugins/acousticbrainz/acousticbrainz.py @@ -19,11 +19,12 @@ PLUGIN_NAME = 'AcousticBrainz Mood-Genre' PLUGIN_AUTHOR = 'Andrew Cook, Sambhav Kothari' PLUGIN_DESCRIPTION = '''Uses AcousticBrainz for mood and genre. +Any existing genres saved in %_mbgenre%. WARNING: Experimental plugin. All guarantees voided by use.''' PLUGIN_LICENSE = "GPL-2.0" PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.txt" -PLUGIN_VERSION = "1.2.1" +PLUGIN_VERSION = "1.2.2" PLUGIN_API_VERSIONS = ["2.0"] from functools import partial @@ -56,6 +57,7 @@ def result(album, metadata, data, reply, error): if k.startswith("mood_") and not v["value"].startswith("not_"): moods.append(v["value"]) + metadata["~mbgenre"] = metadata.getall("genre") metadata["genre"] = genres metadata["mood"] = moods log.debug("%s: Track %s (%s) Parsed response (genres: %s, moods: %s)", PLUGIN_NAME, metadata["musicbrainz_recordingid"], metadata["title"], str(genres), str(moods))