From fec916dfbeedd8798c67a7512147b343dd046f90 Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Tue, 8 Mar 2016 17:23:15 +0300 Subject: [PATCH] Check tags for existence before using them Closes bug 5401 --- mediagoblin/media_types/video/util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mediagoblin/media_types/video/util.py b/mediagoblin/media_types/video/util.py index d3d29279..10705eab 100644 --- a/mediagoblin/media_types/video/util.py +++ b/mediagoblin/media_types/video/util.py @@ -30,10 +30,15 @@ def skip_transcode(metadata, size): config = mgg.global_config['plugins']['mediagoblin.media_types.video']\ ['skip_transcode'] + # XXX: how were we supposed to use it? medium_config = mgg.global_config['media:medium'] _log.debug('skip_transcode config: {0}'.format(config)) + tags = metadata.get_tags() + if not tags: + return False + if config['mime_types'] and tags.get_string('mimetype')[0]: if not tags.get_string('mimetype')[1] in config['mime_types']: return False -- 2.25.1