sane-tag-music: handle titles with "/"
This commit is contained in:
@@ -108,7 +108,7 @@ def clean_for_loose_compare(a: str) -> str:
|
|||||||
# goal is to help merge path-extracted tags with embedded tags.
|
# goal is to help merge path-extracted tags with embedded tags.
|
||||||
# it's common for a tag to have some rich characters which can't be represented in a file.
|
# it's common for a tag to have some rich characters which can't be represented in a file.
|
||||||
# so just remove rich characters, but in a way which doesn't become useless when faced with primarily non-latin names
|
# so just remove rich characters, but in a way which doesn't become useless when faced with primarily non-latin names
|
||||||
omitable = '.- &()[];:'
|
omitable = '.- &()[];:/'
|
||||||
unomitable = 'abcdefghijklmnopqrstuvwxyz0123456789'
|
unomitable = 'abcdefghijklmnopqrstuvwxyz0123456789'
|
||||||
|
|
||||||
a = "".join(c for c in a if c not in omitable)
|
a = "".join(c for c in a if c not in omitable)
|
||||||
@@ -133,6 +133,7 @@ def clean_for_fs(a: str, single_field: bool=False) -> str:
|
|||||||
a = romanize(a)
|
a = romanize(a)
|
||||||
a = a.strip()
|
a = a.strip()
|
||||||
a = a.replace(" ", ".")
|
a = a.replace(" ", ".")
|
||||||
|
a = a.replace("/", ".")
|
||||||
if single_field:
|
if single_field:
|
||||||
a = a.replace("-", ".")
|
a = a.replace("-", ".")
|
||||||
|
|
||||||
@@ -140,6 +141,9 @@ def clean_for_fs(a: str, single_field: bool=False) -> str:
|
|||||||
|
|
||||||
while ".." in a:
|
while ".." in a:
|
||||||
a = a.replace("..", ".")
|
a = a.replace("..", ".")
|
||||||
|
while a.startswith("."):
|
||||||
|
# files which start with `.` are hidden on the fs, so don't do that
|
||||||
|
a = a[1:]
|
||||||
return a
|
return a
|
||||||
|
|
||||||
def clean_fields_for_fs(a: list[str], single_fields: bool=True) -> str:
|
def clean_fields_for_fs(a: list[str], single_fields: bool=True) -> str:
|
||||||
|
Reference in New Issue
Block a user