get_artwork_id()
If I already have the song id, there is no reason I should have to look up the filepath to set the artwork.
This commit is contained in:
parent
1f8b72185f
commit
37fd8c953c
|
@ -61,13 +61,16 @@ def lfm_cache_album(file, artist, album):
|
|||
pass
|
||||
return False
|
||||
|
||||
def get_artwork(filepath):
|
||||
id = file_to_id(filepath)
|
||||
if id == None:
|
||||
return
|
||||
def get_artwork_id(id):
|
||||
artist = libsaria.collection.get_attr(id, "artist")
|
||||
album = libsaria.collection.get_attr(id, "album")
|
||||
cached = cache[artist]
|
||||
file = cached.get("%s.jpg" % album, lfm_cache_album, artist, album)
|
||||
libsaria.event.start("POSTGETART", file)
|
||||
|
||||
def get_artwork(filepath):
|
||||
id = file_to_id(filepath)
|
||||
if id == None:
|
||||
return
|
||||
return get_artwork_id(id)
|
||||
libsaria.event.invite("POSTLOAD", get_artwork, True)
|
||||
|
|
Loading…
Reference in New Issue