From fc4b59a0844a2eda1fdecb5bde43a6b16ed3a88d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 25 Oct 2011 01:07:50 +0200 Subject: [PATCH] poster --- pandora/item/models.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 9f2c43365..3484c1e76 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -917,15 +917,14 @@ class Item(models.Model): def make_poster(self, force=False): if not self.poster or force: - url = self.prefered_poster_url() + self.delete_poster() poster = self.make_siteposter() + url = self.prefered_poster_url() if url: data = ox.net.readUrl(url) - self.delete_poster() self.poster.save('poster.jpg', ContentFile(data)) self.save() - else: - self.delete_poster() + elif os.path.exists(poster): with open(poster) as f: self.poster.save('poster.jpg', ContentFile(f.read()))