diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index ea8ef24da..211f4c42f 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -74,6 +74,8 @@ RELEASE_INCLUDES = ['artists', 'media', 'recordings', 'release-groups', TRACK_INCLUDES = ['artists', 'aliases'] if 'work-level-rels' in musicbrainzngs.VALID_INCLUDES['recording']: TRACK_INCLUDES += ['work-level-rels', 'artist-rels'] +if 'genres' in musicbrainzngs.VALID_INCLUDES['recording']: + RELEASE_INCLUDES += ['genres'] def track_url(trackid): @@ -415,6 +417,10 @@ def album_info(release): first_medium = release['medium-list'][0] info.media = first_medium.get('format') + genres = release.get('genre-list') + if genres: + info.genre = ';'.join(g['name'] for g in genres) + info.decode() return info diff --git a/docs/changelog.rst b/docs/changelog.rst index a530cbac1..70fb5ad43 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -159,6 +159,11 @@ New features: * :doc:`/plugins/web`: add DELETE and PATCH methods for modifying items * :doc:`/plugins/lyrics`: Removed LyricWiki source (shut down on 21/09/2020). * Added a ``--plugins`` (or ``-p``) flag to specify a list of plugins at startup. +* Use musicbrainz genre tag api to get genre information. This currently + depends on functionality that is currently unreleased in musicbrainzngs. + See https://github.com/alastair/python-musicbrainzngs/pull/247 and + https://github.com/alastair/python-musicbrainzngs/pull/266 . + Thanks to :user:`aereaux`. Fixes: