From 613faa2e3b16ba3b65d3f82ef6b4695d0ffecd50 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 21 Nov 2014 18:58:42 +0000 Subject: [PATCH] update poster ratio saving poster, fixes #2517 --- pandora/item/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index 4c2fb18f4..d3f3457e7 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1332,6 +1332,12 @@ class Item(models.Model): poster = self.poster.path with open(poster, 'w') as f: f.write(data) + self.poster_height = self.poster.height + self.poster_width = self.poster.width + if self.json.get('posterRatio') != self.poster_width / self.poster_height: + self.json = self.get_json() + Item.objects.filter(id=self.id).update(json=self.json, + poster_width=self.poster_width, poster_height=self.poster_height) def prefered_poster_url(self): if settings.DATA_SERVICE: