Commit 3dbb738d authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

make sure we are cleaning up destination filenames before renaming

parent e953a874
......@@ -184,7 +184,7 @@ class PostProcessor(object):
base_name = re.sub(r'[\[\]\*\?]', r'[\g<0>]', base_name)
if subfolders: # subfolders are only checked in show folder, so names will always be exactly alike
filelist = ek.ek(recursive_glob, ek.ek(os.path.dirname, file_path), base_name + '*') # just create the list of all files starting with the basename
filelist = ek.ek(recursive_glob, ek.ek(os.path.dirname, file_path), base_name + '*') # just create the list of all files starting with the basename
else: # this is called when PP, so we need to do the filename check case-insensitive
filelist = []
checklist = ek.ek(glob.glob, ek.ek(os.path.join, ek.ek(os.path.dirname, file_path), '*')) # get a list of all the files in the folder
......
......@@ -2500,7 +2500,7 @@ class TVEpisode(object):
# split off the dirs only, if they exist
name_groups = re.split(r'[\\/]', pattern)
return self._format_pattern(name_groups[-1], multi, anime_type)
return helpers.sanitizeFileName(self._format_pattern(name_groups[-1], multi, anime_type))
def rename(self):
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment