Add genre support using musicbrainz tags.

This requires this PR: https://github.com/alastair/python-musicbrainzngs/pull/266
This commit is contained in:
Aidan Epstein 2020-10-23 15:29:29 -07:00
parent 769e4246c1
commit d70287df00
2 changed files with 10 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,9 @@ def album_info(release):
first_medium = release['medium-list'][0]
info.media = first_medium.get('format')
if release.get('genre-list'):
info.genre = ';'.join(g['name'] for g in release['genre-list'])
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: