fix not allowed characters properly

This commit is contained in:
Jakub Trllo 2022-05-11 17:21:40 +02:00
parent 7b225feb13
commit 9640a7463b

View file

@ -493,8 +493,9 @@ def convert_for_ffmpeg(
erase_reason = "has too long value ({} chars).".format(
len(attr_value)
)
erase_attribute = True
if erase_attribute:
if not erase_attribute:
for char in NOT_ALLOWED_FFMPEG_CHARS:
if char in attr_value:
erase_attribute = True
@ -623,14 +624,16 @@ def convert_input_paths_for_ffmpeg(
erase_reason = "has too long value ({} chars).".format(
len(attr_value)
)
erase_attribute = True
for char in NOT_ALLOWED_FFMPEG_CHARS:
if char in attr_value:
erase_attribute = True
erase_reason = (
"contains unsupported character \"{}\"."
).format(char)
break
if not erase_attribute:
for char in NOT_ALLOWED_FFMPEG_CHARS:
if char in attr_value:
erase_attribute = True
erase_reason = (
"contains unsupported character \"{}\"."
).format(char)
break
if erase_attribute:
# Set attribute to empty string