From a1909c95b9c2b508a0a5e969fada9332d8b01eff Mon Sep 17 00:00:00 2001 From: j Date: Tue, 25 Sep 2018 11:31:13 +0200 Subject: [PATCH] avoid division by zero, fixes #3169 --- 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 01d7632d..3750d3ac 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -622,7 +622,8 @@ class Item(models.Model): i['connections'] = self.expand_connections() if not keys or 'posterRatio' in keys: - i['posterRatio'] = self.poster_width / self.poster_height + if self.poster_height: + i['posterRatio'] = self.poster_width / self.poster_height streams = self.streams() i['durations'] = [s.duration for s in streams] @@ -1479,7 +1480,7 @@ class Item(models.Model): timeline = audio_timeline cmd = [settings.ITEM_POSTER, '-d', '-', '-p', poster] - data = self.cache.copy() + data = self.json() if frame: data['frame'] = frame if os.path.exists(timeline):