diff options
author | Anton Khirnov <wyskas@gmail.com> | 2010-04-30 08:10:56 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2010-04-30 08:10:56 +0200 |
commit | 1ff1ec58b8ad638e7ffa901a38351cecb3478320 (patch) | |
tree | 989be504d32215adef01a5cc2fdd68cd213cacc1 /nephilim/plugins/AlbumCover.py | |
parent | 60088b7f5c672a3544edbacd88020e591017f653 (diff) |
song: raise KeyError instead of returning empty string
Diffstat (limited to 'nephilim/plugins/AlbumCover.py')
-rw-r--r-- | nephilim/plugins/AlbumCover.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py index b630d76..21aaa8c 100644 --- a/nephilim/plugins/AlbumCover.py +++ b/nephilim/plugins/AlbumCover.py @@ -220,14 +220,14 @@ class AlbumCover(Plugin): name = 'Last.fm' def fetch(self, song): - if not song['artist'] or not song['album']: + if not 'artist' in song or 'album' in song: return self.finish() url = QtCore.QUrl('http://ws.audioscrobbler.com/2.0/') url.setQueryItems([('api_key', 'beedb2a8a0178b8059cd6c7e57fbe428'), ('method', 'album.getInfo'), ('artist', song['artist']), ('album', song['album']), - ('mbid', song['MUSICBRAINZ_ALBUMID'])]) + ('mbid', song['?MUSICBRAINZ_ALBUMID'])]) self.fetch2(song, url) self.rep.finished.connect(self.__handle_search_res) @@ -396,7 +396,7 @@ class AlbumCover(Plugin): self.__abort_fetch() file = QtGui.QFileDialog.getOpenFileName(None, - 'Select album cover for %s - %s'%(song['artist'], song['album']), + 'Select album cover for %s - %s'%(song['?artist'], song['?album']), self.__cover_dir, '') if not file: return |