summaryrefslogtreecommitdiff
path: root/nephilim/plugins/AlbumCover.py
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-05-02 16:24:15 +0200
committerAnton Khirnov <wyskas@gmail.com>2009-05-02 16:24:15 +0200
commita0e422fc5ec3a6ee7b3d41061157f6041f704219 (patch)
tree2b4198a411401d2de6057a3126e031bf7d0756be /nephilim/plugins/AlbumCover.py
parente079fa01b121198f87888acd2bc7e6bbb440ceca (diff)
Use comparison operator for Song.
Diffstat (limited to 'nephilim/plugins/AlbumCover.py')
-rw-r--r--nephilim/plugins/AlbumCover.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py
index f4b246f..a12ac27 100644
--- a/nephilim/plugins/AlbumCover.py
+++ b/nephilim/plugins/AlbumCover.py
@@ -78,8 +78,6 @@ class wgAlbumCover(QtGui.QLabel):
def set_cover(self, song, cover, write = False):
"""Set cover for current song, attempt to write it to a file
if write is True and it's globally allowed."""
- if song.filepath() != self.plugin.mpclient().current_song().filepath():
- return
logging.info('Setting cover')
if not cover or cover.isNull():
@@ -89,6 +87,9 @@ class wgAlbumCover(QtGui.QLabel):
self.plugin.emit(QtCore.SIGNAL('cover_changed'), None)
return
+ if song != self.plugin.mpclient().current_song():
+ return
+
self.cover = QtGui.QPixmap.fromImage(cover)
self.cover_loaded = True
self.setPixmap(self.cover.scaled(self.size(), QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation))
@@ -116,7 +117,7 @@ class wgAlbumCover(QtGui.QLabel):
def _fetch_cover(self):
song = self.plugin.mpclient().current_song()
if not song:
- return self.emit(QtCore.SIGNAL('new_cover_fetched'), None)
+ return self.emit(QtCore.SIGNAL('new_cover_fetched'), None, None)
if self.sender() == self.plugin.mpclient():
fetch_func = self._fetch_auto