Artwork not embedded if no ASIN

If no ASIN then last.fm not being checked and artwork not embedded
correctly
This commit is contained in:
Ade
2012-10-08 21:48:40 +13:00
parent a57167f3c0
commit c17ede266c
2 changed files with 6 additions and 2 deletions

View File

@@ -21,6 +21,9 @@ def getAlbumArt(albumid):
myDB = db.DBConnection()
asin = myDB.action('SELECT AlbumASIN from albums WHERE AlbumID=?', [albumid]).fetchone()[0]
if not asin:
return None
url = 'http://ec1.images-amazon.com/images/P/%s.01.LZZZZZZZ.jpg' % asin
return url

View File

@@ -240,8 +240,9 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list)
album_art_path = albumart.getAlbumArt(albumid)
if headphones.EMBED_ALBUM_ART or headphones.ADD_ALBUM_ART:
artwork = urllib.urlopen(album_art_path).read()
if len(artwork) < 100:
if album_art_path:
artwork = urllib.urlopen(album_art_path).read()
if not album_art_path or len(artwork) < 100:
logger.info("No suitable album art found from Amazon. Checking Last.FM....")
artwork = albumart.getCachedArt(albumid)
if not artwork or len(artwork) < 100: