From 70bf214ec952288bbdd7e0687af9320a5ad11c5d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 8 Feb 2011 15:58:10 +0530 Subject: [PATCH] without timeline there are no local posters --- pandora/item/models.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 3fe2dbf6d..30373a777 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -726,6 +726,10 @@ class Item(models.Model): def local_posters(self): part = 1 posters = {} + timeline = self.path('timeline.64.png') + timeline = os.path.abspath(os.path.join(settings.MEDIA_ROOT, timeline)) + if not os.path.exists(timeline): + return posters if self.poster_frame >= 0: frame = self.get_poster_frame_path() path = self.path('poster.pandora.%s.%s.jpg'%(part, self.poster_frame)) @@ -742,11 +746,11 @@ class Item(models.Model): def make_local_posters(self): posters = self.local_posters() - for poster in posters: - frame = posters[poster] - timeline = self.path('timeline.64.png') - timeline = os.path.abspath(os.path.join(settings.MEDIA_ROOT, timeline)) - if os.path.exists(timeline): + timeline = self.path('timeline.64.png') + timeline = os.path.abspath(os.path.join(settings.MEDIA_ROOT, timeline)) + if os.path.exists(timeline): + for poster in posters: + frame = posters[poster] cmd = [settings.ITEM_POSTER, '-t', self.get('title'), '-d', ', '.join(self.get('director', ['Unknown Director'])),