From 6f2640f5582361b5656447a21077cb770cda437a Mon Sep 17 00:00:00 2001 From: rembo10 Date: Sat, 23 Jun 2012 12:56:41 +0530 Subject: [PATCH] Fixed the if/else block when writing info files - before it was writing the info file even if it existed and was current --- headphones/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headphones/cache.py b/headphones/cache.py index 86639a95..c95882f4 100644 --- a/headphones/cache.py +++ b/headphones/cache.py @@ -309,7 +309,7 @@ class Cache(object): # If there is no info, we should either write an empty file, or make an older file current # just so it doesn't check it every time - else: + elif not info and not (self.info_files and self._is_current(self.info_files[0])): new_info_file_path = os.path.join(self.path_to_info_cache, self.id + '.' + helpers.today() + '.txt') @@ -335,7 +335,7 @@ class Cache(object): f = open(new_info_file_path, 'w') f.close() - # Should we grab the artwork here if we're just grabbing thumbs or info?? + # Should we grab the artwork here if we're just grabbing thumbs or info?? Probably not since the files can be quite big if image_url and self.query_type == 'artwork': myDB = db.DBConnection()