From a8c1b8385a27df419cd76ee76d0bdd73ac447e82 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 16 Nov 2014 18:25:54 +0000 Subject: [PATCH] rebuild poster if itemKey with poster: true is changed --- pandora/item/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index afcef387..3e6ca171 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -288,7 +288,7 @@ class Item(models.Model): else: self.data[key] = ox.escape_html(data[key]) p = self.save() - if not settings.USE_IMDB and filter(lambda k: k in ('title', 'director', 'year'), data): + if not settings.USE_IMDB and filter(lambda k: k in self.poster_keys, data): p = tasks.update_poster.delay(self.public_id) return p @@ -1608,6 +1608,7 @@ def delete_item(sender, **kwargs): pre_delete.connect(delete_item, sender=Item) Item.facet_keys = [] +Item.poster_keys = [] for key in settings.CONFIG['itemKeys']: if 'autocomplete' in key and not 'autocompleteSortKey' in key or \ key.get('filter'): @@ -1615,7 +1616,8 @@ for key in settings.CONFIG['itemKeys']: elif key.get('type') == 'layer' and \ utils.get_by_id(settings.CONFIG['layers'], key['id']).get('type') == 'string': Item.facet_keys.append(key['id']) - + if key['id'] in ('title', 'director', 'year') or key.get('poster'): + Item.poster_keys.append(key['id']) Item.person_keys = [] for key in settings.CONFIG['itemKeys']: