diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index 159d623d5..d063f6278 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -310,9 +310,9 @@ def match_album(artist, album, tracks=None, limit=SEARCH_LIMIT): optionally, a number of tracks on the album. """ # Build search criteria. - criteria = {'release': album.lower()} + criteria = {'release': album.lower().strip()} if artist is not None: - criteria['artist'] = artist.lower() + criteria['artist'] = artist.lower().strip() else: # Various Artists search. criteria['arid'] = VARIOUS_ARTISTS_ID @@ -341,8 +341,8 @@ def match_track(artist, title, limit=SEARCH_LIMIT): objects. May raise a MusicBrainzAPIError. """ criteria = { - 'artist': artist.lower(), - 'recording': title.lower(), + 'artist': artist.lower().strip(), + 'recording': title.lower().strip(), } if not any(criteria.itervalues()): diff --git a/docs/changelog.rst b/docs/changelog.rst index 38f99638d..d76eeeb69 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -44,6 +44,8 @@ Fixes: the Discogs servers. Thanks to Dustin Rodriguez. * :doc:`/plugins/embedart`: Do not log "embedding album art into..." messages during the import process. +* Fix a crash in the autotagger when files had only whitespace in their + metadata. 1.3.8 (September 17, 2014)