Skip to content

Commit

Permalink
Add genre support using musicbrainz tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
aereaux committed Oct 26, 2020
1 parent c9f59ee commit a168f44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion beets/autotag/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_message(self):
RELEASE_INCLUDES = ['artists', 'media', 'recordings', 'release-groups',
'labels', 'artist-credits', 'aliases',
'recording-level-rels', 'work-rels',
'work-level-rels', 'artist-rels']
'work-level-rels', 'artist-rels', 'genres']
TRACK_INCLUDES = ['artists', 'aliases']
if 'work-level-rels' in musicbrainzngs.VALID_INCLUDES['recording']:
TRACK_INCLUDES += ['work-level-rels', 'artist-rels']
Expand Down Expand Up @@ -415,6 +415,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

Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ New features:
be deleted after importing.
Thanks to :user:`logan-arens`.
:bug:`2947`
* Use musicbrainz genre tag api to get genre information.
Thanks to :user:`aereaux`.

Fixes:

Expand Down

0 comments on commit a168f44

Please sign in to comment.