From 5bb0c016545a73062f29682df9623bda6566fcb2 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 18 Jul 2012 18:46:09 +0530 Subject: [PATCH] Check cache/last.fm for album art --- headphones/postprocessor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index b4363d0f..602ee4fc 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -26,7 +26,7 @@ from lib.beets import autotag from lib.beets.mediafile import MediaFile import headphones -from headphones import db, albumart, lyrics, logger, helpers +from headphones import db, albumart, lyrics, logger, helpers, cache postprocessor_lock = threading.Lock() @@ -238,8 +238,11 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list) if headphones.EMBED_ALBUM_ART or headphones.ADD_ALBUM_ART: artwork = urllib.urlopen(album_art_path).read() if len(artwork) < 100: - artwork = False - logger.info("No suitable album art found. Not adding album art") + logger.info("No suitable album art found from Amazon. Checking Last.FM....") + artwork = urllib.urlopen(cache.getArtwork(AlbumID=albumid)).read() + if len(artwork) < 100: + artwork = False + logger.info("No suitable album art found from Last.FM. Not adding album art") if headphones.EMBED_ALBUM_ART and artwork: embedAlbumArt(artwork, downloaded_track_list)