Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rembo10 committed Oct 9, 2012
2 parents fb6371b + 93396ac commit 35353ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions headphones/albumart.py
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions headphones/postprocessor.py
Expand Up @@ -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:
Expand Down

0 comments on commit 35353ed

Please sign in to comment.