From e20b784d23a9756d95a8d6b4a9d8b29c15e93665 Mon Sep 17 00:00:00 2001 From: David Kifer Date: Wed, 1 Jul 2026 08:39:24 -0400 Subject: [PATCH] Improve matchingJob lookup in visual gallery using output_file basename --- static/app.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/static/app.js b/static/app.js index 599edab..84411df 100644 --- a/static/app.js +++ b/static/app.js @@ -1353,9 +1353,15 @@ async function loadGallery() { galleryGrid.innerHTML = ""; outputs.forEach(file => { - const basename = file.filename.replace("upscaled_", ""); - const jobId = basename.split(".")[0]; - const matchingJob = jobs.find(j => j.job_id === jobId); + const matchingJob = jobs.find(j => { + if (j.output_file) { + const jobFilename = j.output_file.split("/").pop(); + if (jobFilename === file.filename) return true; + } + const basename = file.filename.replace("upscaled_", ""); + const jobId = basename.split(".")[0]; + return j.job_id === jobId; + }); const card = document.createElement("div"); card.className = "gallery-card";