fix wrong filenames for ntfs. removed double quote from filenames
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ivan Schaller 2022-05-11 18:05:26 +02:00
parent 516d0b74a1
commit ce67407bf4
2 changed files with 2 additions and 2 deletions

View file

@ -57,7 +57,7 @@ def get_chapter_list(chapters):
# remove illegal characters etc
def fix_name(filename):
# remove illegal characters
filename = re.sub("[\\\/\<\>\:\;\|\?\*\!\@]", "", filename)
filename = re.sub('[\\\/\<\>\:\;\|\?\*\!\@"]', "", filename)
# remove multiple dots
filename = re.sub("([\.]{2,})", ".", filename)
# remove dot(s) at the beginning and end of the filename

View file

@ -69,7 +69,7 @@ def test_fix_name():
filename_in1 = "..hello?; @test1-*<>test2.cbz"
filename_in2 = "!hello: >test1-/test2<!.cbz"
filename_in3 = " hello test1-test2.cbz "
filename_in4 = "hello test1-test2..cbz."
filename_in4 = 'hello "test1"-test2..cbz.'
# out
filename_out = "hello test1-test2.cbz"
assert utils.fix_name(filename_in1) == filename_out