From 0cfaf27b0f04c0ebd97da638236570d115cdc739 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Fri, 22 Jun 2012 13:49:18 +0530 Subject: [PATCH] Get a list of all artwork and info files no matter if it's an artwork or info check --- headphones/cache.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/headphones/cache.py b/headphones/cache.py index f227910e..a86c74f7 100644 --- a/headphones/cache.py +++ b/headphones/cache.py @@ -60,25 +60,24 @@ class Cache(object): pass def _exists(self, type): - + + self.artwork_files = glob.glob(os.path.join(self.path_to_art_cache, self.id + '*')) + self.info_files = glob.glob(os.path.join(self.path_to_info_cache, self.id + '*')) + if type == 'artwork': - - self.artwork_files = glob.glob(os.path.join(self.path_to_art_cache, self.id + '*')) - + if self.artwork_files: return True else: return False - + else: - self.info_files = glob.glob(os.path.join(self.path_to_info_cache, self.id + '*')) - if self.info_files: return True else: return False - + def _get_age(self, date): # There's probably a better way to do this split_date = date.split('-')