Improve matchingJob lookup in visual gallery using output_file basename
This commit is contained in:
+7
-1
@@ -1353,9 +1353,15 @@ async function loadGallery() {
|
|||||||
galleryGrid.innerHTML = "";
|
galleryGrid.innerHTML = "";
|
||||||
|
|
||||||
outputs.forEach(file => {
|
outputs.forEach(file => {
|
||||||
|
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 basename = file.filename.replace("upscaled_", "");
|
||||||
const jobId = basename.split(".")[0];
|
const jobId = basename.split(".")[0];
|
||||||
const matchingJob = jobs.find(j => j.job_id === jobId);
|
return j.job_id === jobId;
|
||||||
|
});
|
||||||
|
|
||||||
const card = document.createElement("div");
|
const card = document.createElement("div");
|
||||||
card.className = "gallery-card";
|
card.className = "gallery-card";
|
||||||
|
|||||||
Reference in New Issue
Block a user