Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strings are not sanitized in directory paths #110

Open
emturnbull opened this issue Oct 22, 2020 · 2 comments
Open

Strings are not sanitized in directory paths #110

emturnbull opened this issue Oct 22, 2020 · 2 comments
Labels

Comments

@emturnbull
Copy link

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).

@lozbrown
Copy link

This seems similar to #100

@WaywardWizard
Copy link

This occurs when --episode-format has a path in addition to the filename.

Resolving MR
#150

Resolving commit
a28f18e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants