From 5c90ff79a04a85761fd84b95d27af35d8807ed07 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 30 Jul 2016 09:39:31 +0200 Subject: [PATCH] cleanup poster cache --- pandora/item/models.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 6b49e354..8ba5dfee 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1403,14 +1403,14 @@ class Item(models.Model): data = f.read() if data: self.save_poster(data) - poster = self.path('poster.jpg') - poster = os.path.abspath(os.path.join(settings.MEDIA_ROOT, poster)) - for f in glob(poster.replace('.jpg', '*.jpg')): - if f != poster: - try: - os.unlink(f) - except OSError: - pass + poster = self.path('poster.jpg') + poster = os.path.abspath(os.path.join(settings.MEDIA_ROOT, poster)) + for f in glob(poster.replace('.jpg', '*.jpg')): + if f != poster: + try: + os.unlink(f) + except OSError: + pass def make_siteposter(self): poster = self.path('siteposter.jpg')