When cleaning file name remove question marks instead of replacing them with dashes
This commit is contained in:
parent
a3a375d142
commit
e269a110a6
@ -400,8 +400,11 @@ def get_safe_filename(
|
|||||||
shorthand_uuid: str) -> str:
|
shorthand_uuid: str) -> str:
|
||||||
"""https://stackoverflow.com/a/71199182"""
|
"""https://stackoverflow.com/a/71199182"""
|
||||||
|
|
||||||
|
log.debug(f"{shorthand_uuid} Removing question marks from file name ...")
|
||||||
|
clean_filename = re.sub(r"""[?]""", "", dirty_filename)
|
||||||
|
|
||||||
log.debug(f"{shorthand_uuid} Replacing unsafe characters in filename with dashes ...")
|
log.debug(f"{shorthand_uuid} Replacing unsafe characters in filename with dashes ...")
|
||||||
clean_filename = re.sub(r"""[/\\?%*:|"<>\x7F\x00-\x1F]""", "-", dirty_filename)
|
clean_filename = re.sub(r"""[/\\?%*:|"<>\x7F\x00-\x1F]""", "-", clean_filename)
|
||||||
|
|
||||||
log.debug(f"{shorthand_uuid} New filename: '{clean_filename}'")
|
log.debug(f"{shorthand_uuid} New filename: '{clean_filename}'")
|
||||||
return clean_filename
|
return clean_filename
|
||||||
|
Loading…
x
Reference in New Issue
Block a user