From de1000591c9afbc95322171e088a6fb8a0349ff8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 2 Mar 2009 18:34:02 +0100 Subject: AlbumCover: fix guessing cover names. --- nephilim/plugins/AlbumCover.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'nephilim') diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py index a1e9981..55e93e8 100644 --- a/nephilim/plugins/AlbumCover.py +++ b/nephilim/plugins/AlbumCover.py @@ -117,17 +117,18 @@ class wgAlbumCover(QtGui.QLabel): self.cover_loaded = True def fetch_local(self, song): + logging.info('Trying to guess local cover name.') # guess cover name covers = ['cover', 'album', 'front'] exts = [] for ext in QtGui.QImageReader().supportedImageFormats(): - exts.append(str(ext)) + exts.append('*.%s'%str(ext)) filter = [] for cover in covers: for ext in exts: - filter.append('*.%s*.%s'%(cover,ext)) + filter.append('*.%s%s'%(cover,ext)) dir = QtCore.QDir(self.cover_dirname) if not dir: @@ -139,6 +140,7 @@ class wgAlbumCover(QtGui.QLabel): if files: cover = QtGui.QPixmap(dir.filePath(files[0])) if not cover.isNull(): + logging.info('Found a cover.') return cover # if this failed, try any supported image @@ -146,7 +148,7 @@ class wgAlbumCover(QtGui.QLabel): files = dir.entryList() if files: return QtGui.QPixmap(dir.filePath(files[0])) - logging.info("done probing: no matching albumcover found") + logging.info('No matching cover found') return None def fetch_amazon_manual(self): -- cgit v1.2.3