mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-22 20:59:27 +00:00
Check cache/last.fm for album art
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user