diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index 122723db5..a70c74834 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -417,18 +417,17 @@ def album_info(release): if reltype: info.albumtype = reltype.lower() - # Log the new-style "primary" and "secondary" release types. - # Eventually, we'd like to actually store this data, but we just log - # it for now to help understand the differences. + # Set the new-style "primary" and "secondary" release types. + albumtypes = [] if 'primary-type' in release['release-group']: rel_primarytype = release['release-group']['primary-type'] if rel_primarytype: - log.debug('primary MB release type: ' + rel_primarytype.lower()) + albumtypes.append(rel_primarytype.lower()) if 'secondary-type-list' in release['release-group']: if release['release-group']['secondary-type-list']: - log.debug('secondary MB release type(s): ' + ', '.join( - [secondarytype.lower() for secondarytype in - release['release-group']['secondary-type-list']])) + for sec_type in release['release-group']['secondary-type-list']: + albumtypes.append(sec_type.lower()) + info.albumtypes = '; '.join(albumtypes) # Release events. info.country, release_date = _preferred_release_event(release) diff --git a/beets/library.py b/beets/library.py index 54ff7eae9..4e8eed001 100644 --- a/beets/library.py +++ b/beets/library.py @@ -494,6 +494,7 @@ class Item(LibModel): 'mb_releasetrackid': types.STRING, 'trackdisambig': types.STRING, 'albumtype': types.STRING, + 'albumtypes': types.STRING, 'label': types.STRING, 'acoustid_fingerprint': types.STRING, 'acoustid_id': types.STRING, @@ -1042,6 +1043,7 @@ class Album(LibModel): 'mb_albumid': types.STRING, 'mb_albumartistid': types.STRING, 'albumtype': types.STRING, + 'albumtypes': types.STRING, 'label': types.STRING, 'mb_releasegroupid': types.STRING, 'asin': types.STRING, @@ -1091,6 +1093,7 @@ class Album(LibModel): 'mb_albumid', 'mb_albumartistid', 'albumtype', + 'albumtypes', 'label', 'mb_releasegroupid', 'asin', diff --git a/docs/changelog.rst b/docs/changelog.rst index c02fe455c..85625011f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,6 +20,10 @@ Major new features: option is set, and sort them by the number of votes. Thanks to :user:`aereaux`. +* Primary and secondary release types from MusicBrainz are now stored in + ``albumtypes`` field. Thanks to :user:`edgars-supe`. + :bug:`2200` + 1.5.0 (August 19, 2021) -----------------------