Merge pull request #4045 from edgars-supe/albumtypes

Store secondary release types
This commit is contained in:
Adrian Sampson 2021-09-09 10:03:17 -04:00 committed by GitHub
commit 4be95e469f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View file

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

View file

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

View file

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