From: Boris Bobrov Date: Tue, 8 Mar 2016 14:23:15 +0000 (+0300) Subject: Check tags for existence before using them X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fec916dfbeedd8798c67a7512147b343dd046f90;p=mediagoblin.git Check tags for existence before using them Closes bug 5401 --- 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