Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Bobrov <breton@cynicmansion.ru>2016-03-08 17:23:15 +0300
committerBoris Bobrov <breton@cynicmansion.ru>2016-03-08 17:37:04 +0300
commitfec916dfbeedd8798c67a7512147b343dd046f90 (patch)
tree07c7010c1f62499be4c60f4ebaac9d972fa4f89d
parentee7db0a3d19a2e55da64e5cfb9c9379f1ce8af6a (diff)
Check tags for existence before using them
Closes bug 5401
-rw-r--r--mediagoblin/media_types/video/util.py5
1 files changed, 5 insertions, 0 deletions
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