summaryrefslogtreecommitdiff
path: root/nephilim/plugins/AlbumCover.py
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-05-12 20:33:02 +0200
committerAnton Khirnov <wyskas@gmail.com>2009-05-12 20:33:02 +0200
commit023dfcba8e223c163e98256bfb608d2dd80b7a87 (patch)
treea2e35580d26aa9632bf00611e3146797dee831c5 /nephilim/plugins/AlbumCover.py
parent0cd5cd718e97a9cf40295bd83939043199f94497 (diff)
Lyrics: support for loading stored lyrics.
also move function for generating metadata paths to misc.py.
Diffstat (limited to 'nephilim/plugins/AlbumCover.py')
-rw-r--r--nephilim/plugins/AlbumCover.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py
index 39c750f..2c1fd55 100644
--- a/nephilim/plugins/AlbumCover.py
+++ b/nephilim/plugins/AlbumCover.py
@@ -23,7 +23,7 @@ import logging
import os
from ..plugin import Plugin
-from ..misc import APPNAME, expand_tags
+from ..misc import APPNAME, expand_tags, generate_metadata_path
# FETCH MODES
AC_NO_FETCH = 0
@@ -134,18 +134,8 @@ class wgAlbumCover(QtGui.QLabel):
logging.info("autorefreshing cover")
# generate filenames
- if QtCore.QDir.isAbsolutePath(song.filepath()):
- self._cover_dirname = os.path.dirname(song.filepath())
- self._cover_filepath = ''
- elif '://' in song.filepath(): # we are streaming
- self._cover_dirname = ''
- self._cover_filepath = ''
- else:
- dirname = self.plugin.settings().value(self.plugin.name() + '/coverdir').toString()
- self._cover_dirname = expand_tags(dirname, (self.plugin.parent(), song))
- filebase = self.plugin.settings().value(self.plugin.name() + '/covername').toString()
- self._cover_filepath = '%s/%s'%(self._cover_dirname,
- expand_tags(filebase, (self.plugin.parent(), song)).replace('/', '_'))
+ (self._cover_dirname, self._cover_filepath) = generate_metadata_path(self.plugin.parent(), song, self.plugin.settings().value(self.plugin.name() + '/coverdir').toString(),
+ self.plugin.settings().value(self.plugin.name() + '/covername').toString())
write = False
if not QtCore.QFile.exists(self._cover_filepath):