mirror of
https://github.com/beetbox/beets.git
synced 2026-01-02 22:12:53 +01:00
Fix #1152: mbcollection: choose release collection
This commit is contained in:
parent
807ff344fd
commit
02e341cded
2 changed files with 13 additions and 3 deletions
|
|
@ -36,7 +36,7 @@ def mb_call(func, *args, **kwargs):
|
|||
return func(*args, **kwargs)
|
||||
except musicbrainzngs.AuthenticationError:
|
||||
raise ui.UserError('authentication with MusicBrainz failed')
|
||||
except musicbrainzngs.ResponseError as exc:
|
||||
except (musicbrainzngs.ResponseError, musicbrainzngs.NetworkError) as exc:
|
||||
raise ui.UserError('MusicBrainz API error: {0}'.format(exc))
|
||||
except musicbrainzngs.UsageError:
|
||||
raise ui.UserError('MusicBrainz credentials missing')
|
||||
|
|
@ -57,11 +57,19 @@ def submit_albums(collection_id, release_ids):
|
|||
def update_album_list(album_list):
|
||||
"""Update the MusicBrainz colleciton from a list of Beets albums
|
||||
"""
|
||||
# Get the collection to modify.
|
||||
# Get the available collections.
|
||||
collections = mb_call(musicbrainzngs.get_collections)
|
||||
if not collections['collection-list']:
|
||||
raise ui.UserError('no collections exist for user')
|
||||
collection_id = collections['collection-list'][0]['id']
|
||||
|
||||
# Get the first release collection. MusicBrainz also has event
|
||||
# collections, so we need to avoid adding to those.
|
||||
for collection in collections['collection-list']:
|
||||
if 'release-count' in collection:
|
||||
collection_id = collection['id']
|
||||
break
|
||||
else:
|
||||
raise ui.UserError('No collection found.')
|
||||
|
||||
# Get a list of all the album IDs.
|
||||
album_ids = []
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ Fixed:
|
|||
* :doc:`/plugins/ftintitle` and :doc:`/plugins/lyrics`: Featuring artists can
|
||||
now be detected when they use the Spanish word *con*. :bug:`1060`
|
||||
:bug:`1143`
|
||||
* :doc:`/plugins/mbcollection`: Fix an "HTTP 400" error caused by a change in
|
||||
the MusicBrainz API. :bug:`1152`
|
||||
|
||||
.. _API changes: http://developer.echonest.com/forums/thread/3650
|
||||
.. _Plex: https://plex.tv/
|
||||
|
|
|
|||
Loading…
Reference in a new issue