diff --git a/pkgs/additional/sane-scripts/src/sane-tag-music b/pkgs/additional/sane-scripts/src/sane-tag-music index 672428248..5eec2c3dd 100755 --- a/pkgs/additional/sane-scripts/src/sane-tag-music +++ b/pkgs/additional/sane-scripts/src/sane-tag-music @@ -108,7 +108,7 @@ def clean_for_loose_compare(a: str) -> str: # 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. # 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' 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 = a.strip() a = a.replace(" ", ".") + a = a.replace("/", ".") if single_field: a = a.replace("-", ".") @@ -140,6 +141,9 @@ def clean_for_fs(a: str, single_field: bool=False) -> str: while ".." in a: 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 def clean_fields_for_fs(a: list[str], single_fields: bool=True) -> str: