When normalizing tag names, collapse whitespace to 1 space.

This commit is contained in:
voussoir 2020-10-25 20:21:52 -07:00
parent 51fa9aac46
commit c9fcb51247

View file

@ -5,6 +5,7 @@ but are returned by the PDB accesses.
import abc
import os
import PIL.Image
import re
import send2trash
import traceback
@ -1275,6 +1276,7 @@ class Tag(ObjectBase, GroupableMixin):
name = name.lower()
name = helpers.remove_control_characters(name)
name = re.sub(r'\s+', ' ', name)
name = name.strip(' .+')
name = name.split('+')[0].split('.')[-1]
name = name.replace('-', '_')