From 70271b464933d54c02a7c664b6972696acb25b54 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 28 Apr 2013 17:00:59 +0000 Subject: [PATCH] dont fail if item has no year --- pandora/item/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 021f727c..0c415a5a 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -74,7 +74,7 @@ def get_item(info, user=None, async=False): } if filter(lambda k: k['id'] == 'year', settings.CONFIG['itemKeys']): - item_data['year'] = info.get('year', '') + item_data['year'] = info.get('year', '') or '' #add additional item metadata parsed from path for key in [i for i in info @@ -1167,7 +1167,8 @@ class Item(models.Model): data = f.read() if data: self.save_poster(data) - poster = self.poster.path + 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: