mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Improvements to thumbnail generation and detail page
This commit is contained in:
@@ -55,12 +55,13 @@ def job_detail(job_id):
|
||||
found_job = RenderQueue.job_with_id(job_id)
|
||||
if found_job:
|
||||
table_html = json2html.json2html.convert(json=found_job.json(),
|
||||
table_attributes='class="table is-narrow is-striped"')
|
||||
table_attributes='class="table is-narrow is-striped is-fullwidth"')
|
||||
media_url = None
|
||||
if found_job.file_list():
|
||||
if found_job.file_list() and found_job.render_status() == RenderStatus.COMPLETED:
|
||||
media_basename = os.path.basename(found_job.file_list()[0])
|
||||
media_url = f"/api/job/{job_id}/file/{media_basename}"
|
||||
return render_template('details.html', detail_table=table_html, media_url=media_url)
|
||||
return render_template('details.html', detail_table=table_html, media_url=media_url,
|
||||
job_status=found_job.render_status().value.title(), job=found_job)
|
||||
return f'Cannot find job with ID {job_id}', 400
|
||||
|
||||
|
||||
@@ -74,7 +75,7 @@ def job_thumbnail(job_id):
|
||||
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'):
|
||||
generate_thumbnail_for_job(found_job, thumb_video_path, thumb_image_path, max_width=120)
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user