Skip to content

Commit

Permalink
Sanitize paths embedded in --episode-format. Issues jkwill87#127 jkwi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Tomlin authored and bok committed Aug 30, 2023
1 parent 07e64a3 commit c77b5f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mnamer/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ def destination(self) -> Path:
dir_head = Path(dir_head_)
else:
dir_head = self.source.parent

file_path = format(self.metadata, self._settings.formatting_for(self.metadata))
dir_tail, filename = path.split(Path(file_path))

# Required to sanitize paths that have been inserted into --episode-format
dir_tail = Path(*[str_sanitize(px) for px in Path(dir_tail).parts])

filename = filename_replace(filename, self._settings.replace_after)
if self._settings.scene:
filename = str_scenify(filename)
Expand Down

0 comments on commit c77b5f4

Please sign in to comment.