diff options
author | jerous <jerous@gmail.com> | 2008-11-04 21:41:18 +0100 |
---|---|---|
committer | jerous <jerous@gmail.com> | 2008-11-04 21:41:18 +0100 |
commit | 46c7d6ae826d719bd7c921813b870940c368c473 (patch) | |
tree | 17b494732f48ae4798c2558ee0f08e540ea9b15f /plugins | |
parent | 9b137e55d67678d07fe0819b73e8508d1ccc9324 (diff) |
AlbumCover: fixie wixie: always copy the file when setting manually
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/AlbumCover.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/AlbumCover.py b/plugins/AlbumCover.py index 4e43cf3..0323e96 100644 --- a/plugins/AlbumCover.py +++ b/plugins/AlbumCover.py @@ -37,10 +37,15 @@ class wgAlbumCover(QtGui.QWidget): , "Images ("+" ".join(map(lambda ext: "*.%s"%(ext), ALBUMCOVER_GFX_EXTS_DEFAULT.split(',')))+")" ) if file: - cur=self.getLocalACPath(monty.getCurrentSong(), True) + cur=self.getLocalACPath(song, probe=True) # remove the previous cover try: - os.remove(cur) + if cur: + self.p.extended("removing %s"%(cur)) + os.remove(cur) + else: + cur=self.getLocalACPath(song, probe=False) + self.p.extended("copy %s to %s"%(file, cur)) shutil.copy(file, cur) except Exception, e: self.p.normal("failed to set new cover: %s"%(str(e))) |