Force thumbnail if new album art has been selected
authorIvan Frade <ivan.frade@gmail.com>
Tue, 1 Sep 2009 20:17:39 +0000 (23:17 +0300)
committerIvan Frade <ivan.frade@gmail.com>
Tue, 1 Sep 2009 20:17:39 +0000 (23:17 +0300)
It was possible to download a new album art and use still the old thumbnail!

src/album_art.py

index 06ae5cd..4ca7344 100755 (executable)
@@ -75,13 +75,13 @@ class MussorgskyAlbumArt:
         if (not album_art_available):
             return (None, None)
 
-        if (os.path.exists (thumbnail) and not force):
-            print "Thumbnail exists " + thumbnail
-        else:
+        if (not os.path.exists (thumbnail) or force or album_art_availble):
             if (not self.__request_thumbnail (filename)):
                 print "Failed doing thumbnail. Probably album art is not an image!"
                 os.remove (filename)
                 return (None, None)
+        else:
+            print "Thumbnail exists (and probably valid) " + thumbnail
             
         return (filename, thumbnail)