Fix bug in file name formatter

This commit is contained in:
Serene-Arc 2021-04-12 18:07:40 +10:00 committed by Ali Parlakci
parent bd9f276acc
commit e35dd9e5d0

View File

@ -43,7 +43,7 @@ class FileNameFormatter:
result = format_string
for key in attributes.keys():
if re.search(fr'(?i).*{{{key}}}.*', result):
key_value = attributes.get(key, 'unknown')
key_value = str(attributes.get(key, 'unknown'))
key_value = bytes(key_value, 'utf-8').decode('unicode-escape')
result = re.sub(fr'(?i){{{key}}}', key_value, result,)
logger.log(9, f'Found key string {key} in name')