mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 12:02:41 +01:00
Set Spotify AlbumInfo.mediums
This commit is contained in:
parent
11ae2679ee
commit
5fbb28637d
2 changed files with 3 additions and 4 deletions
|
|
@ -72,8 +72,8 @@ class AlbumInfo(object):
|
|||
- ``data_source``: The original data source (MusicBrainz, Discogs, etc.)
|
||||
- ``data_url``: The data source release URL.
|
||||
|
||||
The fields up through ``tracks`` are required. The others are
|
||||
optional and may be None.
|
||||
``mediums`` along with the fields up through ``tracks`` are required.
|
||||
The others are optional and may be None.
|
||||
"""
|
||||
def __init__(self, album, album_id, artist, artist_id, tracks, asin=None,
|
||||
albumtype=None, va=False, year=None, month=None, day=None,
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ class SpotifyPlugin(BeetsPlugin):
|
|||
month=month,
|
||||
day=day,
|
||||
label=response_data['label'],
|
||||
mediums=max(medium_totals.keys()),
|
||||
data_source='Spotify',
|
||||
data_url=response_data['external_urls']['spotify'],
|
||||
)
|
||||
|
|
@ -286,8 +287,6 @@ class SpotifyPlugin(BeetsPlugin):
|
|||
if not artist_id:
|
||||
artist_id = artist['id']
|
||||
name = artist['name']
|
||||
# Strip disambiguation number.
|
||||
name = re.sub(r' \(\d+\)$', '', name)
|
||||
# Move articles to the front.
|
||||
name = re.sub(r'^(.*?), (a|an|the)$', r'\2 \1', name, flags=re.I)
|
||||
artist_names.append(name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue