fix malformed query with AND/OR operators (#327)

This commit is contained in:
Adrian Sampson 2012-01-31 15:37:30 -08:00
parent 5a0105b12c
commit cd63be80ba
2 changed files with 6 additions and 4 deletions

View file

@ -144,9 +144,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}
criteria = {'release': album.lower()}
if artist is not None:
criteria['artist'] = artist
criteria['artist'] = artist.lower()
else:
# Various Artists search.
criteria['arid'] = VARIOUS_ARTISTS_ID
@ -168,8 +168,8 @@ def match_track(artist, title, limit=SEARCH_LIMIT):
objects.
"""
criteria = {
'artist': artist,
'recording': title,
'artist': artist.lower(),
'recording': title.lower(),
}
if not any(criteria.itervalues()):

View file

@ -30,6 +30,8 @@ Changelog
* Fix a divide-by-zero crash on zero-length audio files.
* Fix a crash in the ``chroma`` plugin when the Acoustid database had no
recording associated with a fingerprint.
* Fix a crash when an autotagging with an artist or album containing "AND" or
"OR" (upper case).
1.0b12 (January 16, 2012)
-------------------------