mnamer icon indicating copy to clipboard operation
mnamer copied to clipboard

--scene also forces filename to lowercase

Open AndrewAPAC opened this issue 3 years ago • 0 comments

Hi Jessy

Just wondering about the functionality of the --scene option as the last line of the str_scenify function forces the filename to lowercase which I suspect should be the role of --lower.

def str_scenify(filename: str) -> str:
    """Replaces non ascii-alphanumerics with dots."""
    filename = normalize("NFKD", filename)
    filename.encode("ascii", "ignore")
    filename = re.sub(r"\s+", ".", filename)
    filename = re.sub(r"[^.\d\w/]", "", filename)
    filename = re.sub(r"\.+", ".", filename)
    return filename.lower().strip(".")

I found this when adding a --ascii option to remove non ascii characters which the function above appears to do.

If you would like to add what I have done and add an extra option to maintain existing --scene option, I would prefer to do via pull request please :-D

AndrewAPAC avatar Apr 12 '21 09:04 AndrewAPAC