mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 11:32:30 +01:00
Added parsing of secondary album types. Fixes #2200
This commit is contained in:
parent
430369062b
commit
318661b4a9
1 changed files with 12 additions and 5 deletions
|
|
@ -276,11 +276,18 @@ def album_info(release):
|
|||
disambig.append(release.get('disambiguation'))
|
||||
info.albumdisambig = u', '.join(disambig)
|
||||
|
||||
# Release type not always populated.
|
||||
if 'type' in release['release-group']:
|
||||
reltype = release['release-group']['type']
|
||||
if reltype:
|
||||
info.albumtype = reltype.lower()
|
||||
# Considers all release types (both primary and secondary) and stores as a comma-separated string
|
||||
all_types = []
|
||||
if 'primary-type' in release['release-group']:
|
||||
rel_primarytype = release['release-group']['primary-type']
|
||||
if rel_primarytype:
|
||||
all_types.append(rel_primarytype.lower())
|
||||
if 'secondary-type-list' in release['release-group']:
|
||||
for secondarytype in release['release-group']['secondary-type-list']:
|
||||
all_types.append(secondarytype.lower())
|
||||
if len(all_types) != 0:
|
||||
all_types = ','.join(all_types)
|
||||
info.albumtype = all_types.lower()
|
||||
|
||||
# Release dates.
|
||||
release_date = release.get('date')
|
||||
|
|
|
|||
Loading…
Reference in a new issue