From 5f9a394ca9b4f04c612b054baf102dda3ceedfce Mon Sep 17 00:00:00 2001 From: Paul Malcolm Date: Tue, 23 Jul 2019 19:55:28 -0400 Subject: [PATCH] Issue #2860 Fetch more acousticbrainz fields --- beetsplug/acousticbrainz.py | 8 ++++++++ docs/plugins/acousticbrainz.rst | 2 ++ test/test_acousticbrainz.py | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/beetsplug/acousticbrainz.py b/beetsplug/acousticbrainz.py index 01f3ac6ac..725e0d634 100644 --- a/beetsplug/acousticbrainz.py +++ b/beetsplug/acousticbrainz.py @@ -74,6 +74,9 @@ ABSCHEME = { 'sad': 'mood_sad' } }, + 'moods_mirex': { + 'value': 'moods_mirex' + }, 'ismir04_rhythm': { 'value': 'rhythm' }, @@ -82,6 +85,9 @@ ABSCHEME = { 'tonal': 'tonal' } }, + 'timbre': { + 'value': 'timbre' + }, 'voice_instrumental': { 'value': 'voice_instrumental' }, @@ -124,7 +130,9 @@ class AcousticPlugin(plugins.BeetsPlugin): 'mood_party': types.Float(6), 'mood_relaxed': types.Float(6), 'mood_sad': types.Float(6), + 'moods_mirex': types.STRING, 'rhythm': types.Float(6), + 'timbre': types.STRING, 'tonal': types.Float(6), 'voice_instrumental': types.STRING, } diff --git a/docs/plugins/acousticbrainz.rst b/docs/plugins/acousticbrainz.rst index 7c24ffe0d..7d7aed237 100644 --- a/docs/plugins/acousticbrainz.rst +++ b/docs/plugins/acousticbrainz.rst @@ -38,7 +38,9 @@ these fields: * ``mood_party`` * ``mood_relaxed`` * ``mood_sad`` +* ``moods_mirex`` * ``rhythm`` +* ``timbre`` * ``tonal`` * ``voice_instrumental`` diff --git a/test/test_acousticbrainz.py b/test/test_acousticbrainz.py index 0b1407581..4c0b0137b 100644 --- a/test/test_acousticbrainz.py +++ b/test/test_acousticbrainz.py @@ -95,7 +95,9 @@ class MapDataToSchemeTest(unittest.TestCase): ('danceable', 0.143928021193), ('rhythm', 'VienneseWaltz'), ('mood_electronic', 0.339881360531), - ('mood_happy', 0.0894767045975) + ('mood_happy', 0.0894767045975), + ('moods_mirex', "Cluster3"), + ('timbre', "bright") } self.assertEqual(mapping, expected)