From f8e8837d3cf7a434c64ef3a642f0d8765f9dd130 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Tue, 16 Nov 2010 23:01:19 -0500 Subject: [PATCH] Get artwork by (artist, album) This makes it easier to find artwork using (artist, album) as a key. This will probably be the best way to use artwork in the web interface. --- libsaria/lastfm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsaria/lastfm.py b/libsaria/lastfm.py index 9674a50d..990cc88f 100644 --- a/libsaria/lastfm.py +++ b/libsaria/lastfm.py @@ -62,12 +62,15 @@ def lfm_cache_album(file, artist, album): pass return False -def get_artwork_id(id): - artist, album = libsaria.sources.get_attrs(id, "artist", "album") +def get_artwork_tags(artist, album): cached = cache[artist] file = cached.get("%s.jpg" % album, lfm_cache_album, artist, album) return file +def get_artwork_id(id): + artist, album = libsaria.sources.get_attrs(id, "artist", "album") + return get_artwork_tags(artist, album) + def get_artwork(filepath): id = file_to_id(filepath) if id == None: