Improved handling of creating job JSONs as well as better handle loading saved JSONs

This commit is contained in:
Brett Williams
2022-12-14 10:49:18 -08:00
parent 9a9b0304b9
commit 455934daa1
3 changed files with 37 additions and 14 deletions

View File

@@ -33,10 +33,11 @@ def generate_thumbnail_for_job(job, thumb_video_path, thumb_image_path, max_widt
else:
source_path = [job.worker.input_path] # use source if nothing else
# Todo: convert image sequence to animated movie
valid_formats = ['.mp4', '.mov', '.avi', '.mpg', '.mpeg', '.jpg', '.png', '.exr', '.mxf']
is_valid_file_type = any(ele in source_path[0] for ele in valid_formats)
if is_valid_file_type and not os.path.exists(thumb_video_path):
save_first_frame(source_path=source_path[0], dest_path=thumb_image_path, max_width=max_width)
x = threading.Thread(target=generate_thumb_thread, args=(source_path[0],))
x.start()
if source_path:
# Todo: convert image sequence to animated movie
valid_formats = ['.mp4', '.mov', '.avi', '.mpg', '.mpeg', '.jpg', '.png', '.exr', '.mxf']
is_valid_file_type = any(ele in source_path[0] for ele in valid_formats)
if is_valid_file_type and not os.path.exists(thumb_video_path):
save_first_frame(source_path=source_path[0], dest_path=thumb_image_path, max_width=max_width)
x = threading.Thread(target=generate_thumb_thread, args=(source_path[0],))
x.start()