Skip to content

Strings are not sanitized in directory paths #110

@emturnbull

Description

@emturnbull

Strings are not sanitized in the directory path. For example, if you wanted to store TV shows in {series}{series} - S{season}E{episode} format, a colon in {series} will be removed in the filename but not in the directory structure. I tracked this down to str_sanitize being called on the filename but not on the dir_tail in the destination() method in target.py

My clumsy hack of a fix was simply to split the dir_tail into individual directory names and call str_sanitize on them, e.g.

        sep = "\\" if "\\" in dir_tail else "/"
        dir_tail_pieces = dir_tail.split(sep)
        cleaned_pieces = []
        for piece in dir_tail_pieces:
            cleaned_pieces.append(str_sanitize(piece))
        dir_tail = sep.join(cleaned_pieces)

which I added to target.py on line 110 (after the call to sanitize the filename).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions