Check tags for existence before using them
Closes bug 5401
This commit is contained in:
parent
ee7db0a3d1
commit
fec916dfbe
@ -30,10 +30,15 @@ def skip_transcode(metadata, size):
|
|||||||
config = mgg.global_config['plugins']['mediagoblin.media_types.video']\
|
config = mgg.global_config['plugins']['mediagoblin.media_types.video']\
|
||||||
['skip_transcode']
|
['skip_transcode']
|
||||||
|
|
||||||
|
# XXX: how were we supposed to use it?
|
||||||
medium_config = mgg.global_config['media:medium']
|
medium_config = mgg.global_config['media:medium']
|
||||||
|
|
||||||
_log.debug('skip_transcode config: {0}'.format(config))
|
_log.debug('skip_transcode config: {0}'.format(config))
|
||||||
|
|
||||||
tags = metadata.get_tags()
|
tags = metadata.get_tags()
|
||||||
|
if not tags:
|
||||||
|
return False
|
||||||
|
|
||||||
if config['mime_types'] and tags.get_string('mimetype')[0]:
|
if config['mime_types'] and tags.get_string('mimetype')[0]:
|
||||||
if not tags.get_string('mimetype')[1] in config['mime_types']:
|
if not tags.get_string('mimetype')[1] in config['mime_types']:
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user