mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
More thumbnail fixes
This commit is contained in:
@@ -78,14 +78,23 @@ def job_thumbnail(job_id):
|
||||
thumb_video_path = os.path.join(server.config['THUMBS_FOLDER'], found_job.id + '.mp4')
|
||||
thumb_image_path = os.path.join(server.config['THUMBS_FOLDER'], found_job.id + '.jpg')
|
||||
|
||||
if not os.path.exists(thumb_video_path) and not os.path.exists(thumb_video_path + '_IN-PROGRESS'):
|
||||
if not os.path.exists(thumb_video_path) and not os.path.exists(thumb_video_path + '_IN-PROGRESS') and \
|
||||
found_job.render_status() not in [RenderStatus.CANCELLED, RenderStatus.ERROR]:
|
||||
generate_thumbnail_for_job(found_job, thumb_video_path, thumb_image_path, max_width=240)
|
||||
|
||||
if os.path.exists(thumb_video_path) and not os.path.exists(thumb_video_path + '_IN-PROGRESS'):
|
||||
return send_file(thumb_video_path, mimetype="video/mp4")
|
||||
elif os.path.exists(thumb_image_path):
|
||||
return send_file(thumb_image_path, mimetype='image/jpeg')
|
||||
return send_file('static/images/spinner.gif', mimetype="image/gif")
|
||||
elif found_job.render_status() == RenderStatus.RUNNING:
|
||||
return send_file('static/images/gears.png', mimetype="image/png")
|
||||
elif found_job.render_status() == RenderStatus.CANCELLED:
|
||||
return send_file('static/images/cancelled.png', mimetype="image/png")
|
||||
elif found_job.render_status() == RenderStatus.SCHEDULED:
|
||||
return send_file('static/images/scheduled.png', mimetype="image/png")
|
||||
elif found_job.render_status() == RenderStatus.NOT_STARTED:
|
||||
return send_file('static/images/not_started.png', mimetype="image/png")
|
||||
return send_file('static/images/error.png', mimetype="image/png")
|
||||
|
||||
|
||||
# Get job file routing
|
||||
|
||||
Reference in New Issue
Block a user