From 82709f1c1b1069b6aaba11170eefc54347113085 Mon Sep 17 00:00:00 2001 From: Ohm Patel Date: Fri, 1 Jan 2016 01:28:17 -0600 Subject: [PATCH] ABrainz: Added more metadata for plugin to fetch and updated docs --- beetsplug/acousticbrainz.py | 52 ++++++++++++++++++++++++++++++++- docs/plugins/acousticbrainz.rst | 17 ++++++++--- 2 files changed, 64 insertions(+), 5 deletions(-) diff --git a/beetsplug/acousticbrainz.py b/beetsplug/acousticbrainz.py index 8f7bc6f5a..c75849b12 100644 --- a/beetsplug/acousticbrainz.py +++ b/beetsplug/acousticbrainz.py @@ -87,6 +87,31 @@ def fetch_info(log, items): data, ["highlevel", "danceability", "all", "danceable"], ) + item.gender = get_value( + log, + data, + ["highlevel", "gender", "value"], + ) + item.genre_rosamerica = get_value( + log, + data, + ["highlevel", "genre_rosamerica", "value"], + ) + item.mood_acoustic = get_value( + log, + data, + ["highlevel", "mood_acoustic", "all", "acoustic"], + ) + item.mood_aggressive = get_value( + log, + data, + ["highlevel", "mood_aggresive", "all", "aggresive"], + ) + item.mood_electronic = get_value( + log, + data, + ["highlevel", "mood_electronic", "all", "electronic"], + ) item.mood_happy = get_value( log, data, @@ -97,7 +122,32 @@ def fetch_info(log, items): data, ["highlevel", "mood_party", "all", "party"], ) - + item.mood_relaxed = get_value( + log, + data, + ["highlevel", "mood_relaxed", "all", "relaxed"], + ) + item.mood_sad = get_value( + log, + data, + ["highlevel", "mood_sad", "all", "sad"], + ) + item.rhythm = get_value( + log, + data + ["highlevel", "ismir04_rhythm", "value"], + ) + item.tonal = get_value( + log, + data, + ["highlevel", "tonal_atonal", "all", "tonal"], + ) + item.voice_instrumental = get_value( + log, + data, + ["highlevel", "voice_instrumental", "value"], + ) + # Store the data. We only update flexible attributes, so we # don't call `item.try_write()` here. item.store() diff --git a/docs/plugins/acousticbrainz.rst b/docs/plugins/acousticbrainz.rst index 3cb0717e2..b5f07d884 100644 --- a/docs/plugins/acousticbrainz.rst +++ b/docs/plugins/acousticbrainz.rst @@ -14,10 +14,19 @@ Enable the ``acousticbrainz`` plugin in your configuration (see :ref:`using-plug For all tracks with a MusicBrainz recording ID, the plugin currently sets these fields: -* ``danceable``: Predicts how easy the track is to dance to. -* ``mood_happy``: Predicts the probability this track will evoke happiness. -* ``mood_party``: Predicts the probability this track should be played at a - party. +* ``danceable`` +* ``gender`` +* ``genre_rosamerica`` +* ``mood_acoustic`` +* ``mood_aggressive`` +* ``mood_electronic`` +* ``mood_happy`` +* ``mood_party`` +* ``mood_relaxed`` +* ``mood_sad`` +* ``rhythm`` +* ``tonal`` +* ``voice_instrumental`` Automatic Tagging -----------------