From 2c208ea15bd94a7750fd3c44b10af3439f32e8d7 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Fri, 22 Jun 2012 14:31:55 +0530 Subject: [PATCH] Fix for getArtwork if no path (either file path or url) could be retrieved --- headphones/cache.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/headphones/cache.py b/headphones/cache.py index 11eb489f..1144a0f7 100644 --- a/headphones/cache.py +++ b/headphones/cache.py @@ -339,6 +339,9 @@ def getArtwork(ArtistID=None, AlbumID=None): c = Cache() artwork_path = c.get_artwork_from_cache(ArtistID, AlbumID) + if not artwork_path: + return None + if artwork_path.startswith('http://'): return artwork_path else: @@ -348,4 +351,8 @@ def getInfo(ArtistID=None, AlbumID=None): c = Cache() info = c.get_info_from_cache(ArtistID, AlbumID) + + if not info: + return None + return info