Merge pull request #214 from 28598519a/master

Fix k4yt3x#211 bug
This commit is contained in:
K4YT3X 2020-03-23 08:55:16 -04:00 committed by GitHub
commit f50ceecd62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -58,7 +58,7 @@ class ImageCleaner(threading.Thread):
"""
# list all images in the extracted frames
output_frames = [f for f in self.output_directory.iterdir() if f.is_file()]
output_frames = [f.name for f in self.output_directory.iterdir() if f.is_file()]
# compare and remove frames downscaled images that finished being upscaled
# within each thread's extracted frames directory
@ -67,10 +67,8 @@ class ImageCleaner(threading.Thread):
# for each file within all the directories
for file in dir_path.iterdir():
file_path = dir_path / file
# if file also exists in the output directory, then the file
# has already been processed, thus not needed anymore
if file_path.is_file() and file in output_frames:
file_path.unlink(file)
output_frames.remove(file)
if file.is_file() and file.name in output_frames:
file.unlink()
output_frames.remove(file.name)

View File

@ -352,7 +352,7 @@ image_format = config['video2x']['image_format'].lower()
preserve_frames = config['video2x']['preserve_frames']
# load cache directory
if isinstance(config['video2x']['video2x_cache_directory'], str):
if config['video2x']['video2x_cache_directory'] is not None:
video2x_cache_directory = pathlib.Path(config['video2x']['video2x_cache_directory'])
else:
video2x_cache_directory = pathlib.Path(tempfile.gettempdir()) / 'video2x'