Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
2 parents fb6371b + 93396ac commit 35353edfc49caccfe6a5f34b87213bff8846f43f @rembo10 committed Oct 9, 2012
Showing with 6 additions and 2 deletions.
  1. +3 −0 headphones/albumart.py
  2. +3 −2 headphones/postprocessor.py
View
@@ -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:

0 comments on commit 35353ed

Please sign in to comment.