Normalize title before updating EXIF #017 (#193)

This commit is contained in:
Jaisen Mathai 2017-01-23 00:23:49 -08:00 committed by GitHub
parent ce98e89c65
commit ed1dbc6c9a
1 changed files with 2 additions and 1 deletions

View File

@ -65,8 +65,9 @@ def parse_original_name_from_media(metadata):
trimmed_base_name = re.sub(date_regex, '', base_name)
if title:
normalized_title = re.sub(r'\W+', '-', title.lower())
trimmed_base_name = trimmed_base_name.replace(
'-{}'.format(title),
'-{}'.format(normalized_title),
''
)