Proper handling of tags in skip_transcode
The function to retrieve tags was used incorrectly in skip_transcode, assuming that str will be returned. Now the code is aware of the return format of the function. Closes bug 5065
This commit is contained in:
parent
bd50f8bf70
commit
4522ecef80
@ -34,24 +34,24 @@ def skip_transcode(metadata, size):
|
|||||||
|
|
||||||
_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 config['mime_types'] and tags.get_string('mimetype'):
|
if config['mime_types'] and tags.get_string('mimetype')[0]:
|
||||||
if not tags.get_string('mimetype') in config['mime_types']:
|
if not tags.get_string('mimetype')[1] in config['mime_types']:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if config['container_formats'] and tags.get_string('container-format'):
|
if config['container_formats'] and tags.get_string('container-format')[0]:
|
||||||
if not (metadata.get_tags().get_string('container-format') in
|
if not (tags.get_string('container-format')[1] in
|
||||||
config['container_formats']):
|
config['container_formats']):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if config['video_codecs']:
|
if config['video_codecs']:
|
||||||
for video_info in metadata.get_video_streams():
|
for video_info in metadata.get_video_streams():
|
||||||
if not (video_info.get_tags().get_string('video-codec') in
|
if not (video_info.get_tags().get_string('video-codec')[1] in
|
||||||
config['video_codecs']):
|
config['video_codecs']):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if config['audio_codecs']:
|
if config['audio_codecs']:
|
||||||
for audio_info in metadata.get_audio_streams():
|
for audio_info in metadata.get_audio_streams():
|
||||||
if not (audio_info.get_tags().get_string('audio-codec') in
|
if not (audio_info.get_tags().get_string('audio-codec')[1] in
|
||||||
config['audio_codecs']):
|
config['audio_codecs']):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user