diff --git a/lib/client/dashboard_window.py b/lib/client/dashboard_window.py index 2f4995e..0e9ebab 100644 --- a/lib/client/dashboard_window.py +++ b/lib/client/dashboard_window.py @@ -185,7 +185,7 @@ class DashboardWindow: job_id = self.selected_job_id() if job_id: # update thumb - response = self.server_proxy.request(f'job/{job_id}/thumbnail?size=big&video_ok=false') + response = self.server_proxy.request(f'job/{job_id}/thumbnail?size=big') if response.ok: try: import io diff --git a/lib/server/job_server.py b/lib/server/job_server.py index e9565ae..4c9d944 100755 --- a/lib/server/job_server.py +++ b/lib/server/job_server.py @@ -72,7 +72,7 @@ def job_detail(job_id): @server.route('/api/job//thumbnail') def job_thumbnail(job_id): big_thumb = request.args.get('size', False) == "big" - video_ok = request.args.get('video_ok', True) + video_ok = request.args.get('video_ok', False) found_job = RenderQueue.job_with_id(job_id, none_ok=True) if found_job: @@ -92,15 +92,22 @@ def job_thumbnail(job_id): found_job.status not in [RenderStatus.CANCELLED, RenderStatus.ERROR]: generate_thumbnail_for_job(found_job, big_video_path, big_image_path, max_width=800) - if big_thumb and video_ok and os.path.exists(big_video_path) and not os.path.exists(big_video_path + '_IN-PROGRESS'): - return send_file(big_video_path, mimetype="video/mp4") - elif big_thumb and os.path.exists(big_image_path): + # generated videos + if video_ok: + if big_thumb and os.path.exists(big_video_path) and not os.path.exists( + big_video_path + '_IN-PROGRESS'): + return send_file(big_video_path, mimetype="video/mp4") + elif 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") + + # Generated thumbs + if big_thumb and os.path.exists(big_image_path): return send_file(big_image_path, mimetype='image/jpeg') - elif video_ok and 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') - elif found_job.status == RenderStatus.RUNNING: + + # Misc status icons + if found_job.status == RenderStatus.RUNNING: return send_file('static/images/gears.png', mimetype="image/png") elif found_job.status == RenderStatus.CANCELLED: return send_file('static/images/cancelled.png', mimetype="image/png") @@ -108,6 +115,7 @@ def job_thumbnail(job_id): return send_file('static/images/scheduled.png', mimetype="image/png") elif found_job.status == RenderStatus.NOT_STARTED: return send_file('static/images/not_started.png', mimetype="image/png") + # errors return send_file('static/images/error.png', mimetype="image/png") diff --git a/lib/server/static/js/job_table.js b/lib/server/static/js/job_table.js index 7d2208a..a2b93d9 100644 --- a/lib/server/static/js/job_table.js +++ b/lib/server/static/js/job_table.js @@ -2,7 +2,7 @@ const grid = new gridjs.Grid({ columns: [ { data: (row) => row.id, name: 'Thumbnail', - formatter: (cell) => gridjs.html(``), + formatter: (cell) => gridjs.html(``), sort: {enabled: false} }, { id: 'name',