From ebe573910a5f1aae69b5d6ba2b662a8e12682b6f Mon Sep 17 00:00:00 2001 From: Jacob Zelek Date: Sat, 26 Dec 2020 15:27:04 -0800 Subject: [PATCH] Skip over thumbnails that already exist --- generator | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/generator b/generator index 5b37e60..35d8faa 100755 --- a/generator +++ b/generator @@ -100,11 +100,17 @@ def worker(queue): # If no work unit then quit if not work_unit: break + # Handle exception when no more items in queue except: break input_file, output_file, interval, size, columns = work_unit + # Skip over any thumbnails that exist already + if os.path.exists(output_file): + print("[{}] Already exists, skipping".format(output_file)) + continue + try: video_file_clip = VideoFileClip(input_file) output_prefix = get_output_prefix() @@ -114,7 +120,7 @@ def worker(queue): generate_sprite_from_frames(output_prefix, columns, size, output_file) except: - print("Error occurred with file: {}".format(file_name)) + print("[{}] Error occurred with file".format(file_name)) def generate_frames(file_name, video_file_clip, interval, output_prefix, size):