Merge pull request #3781 from aereaux/add_genres

Add genre support using musicbrainz tags.
This commit is contained in:
Adrian Sampson 2020-10-28 18:51:01 -04:00 committed by GitHub
commit 072e1dfead
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -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

View file

@ -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: