mirror of
https://github.com/rembo10/headphones.git
synced 2026-04-20 11:59:36 +01:00
Merge remote-tracking branch 'AdeHub/master' into develop
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user