From 19bb7e3b83826f3701837a954a83d10257e7d451 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 18 Nov 2023 12:14:12 +0100 Subject: [PATCH] don't fail if hieght is None --- pandora/archive/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 626df46d..c87df69d 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -404,7 +404,7 @@ class File(models.Model): config = settings.CONFIG['video'] height = self.info['video'][0]['height'] if self.info.get('video') else None max_resolution = max(config['resolutions']) - if height <= max_resolution and self.extension in ('mov', 'mkv', 'mp4', 'm4v'): + if height and height <= max_resolution and self.extension in ('mov', 'mkv', 'mp4', 'm4v'): vcodec = self.get_codec('video') acodec = self.get_codec('audio') if vcodec in self.MP4_VCODECS and acodec in self.MP4_ACODECS: @@ -415,7 +415,7 @@ class File(models.Model): config = settings.CONFIG['video'] height = self.info['video'][0]['height'] if self.info.get('video') else None max_resolution = max(config['resolutions']) - if height <= max_resolution and config['formats'][0] == self.extension: + if height and height <= max_resolution and config['formats'][0] == self.extension: vcodec = self.get_codec('video') acodec = self.get_codec('audio') if self.extension in ['mp4', 'm4v'] and vcodec in self.MP4_VCODECS and acodec in self.MP4_ACODECS: