From 07b81890053bab3dc5ccdc07fd6d422a6b00c8a4 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Mon, 26 Oct 2026 19:43:13 -0700 Subject: [PATCH] fix(lora): link each LoRA's cover as its newest image (#355) Workspace lists show a prompt's media newest link first, so the import links a record's images last to first: the card shows the cover (a still in front of a leading video) the import put first. --- database/category_import.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/database/category_import.py b/database/category_import.py index 89e876ed..ce0b2d5a 100644 --- a/database/category_import.py +++ b/database/category_import.py @@ -192,7 +192,10 @@ class CategoryImportOperations: outcome = "imported" created[prompt_hash] = prompt_id result[_COUNTERS[outcome]] += 1 - for image in record.get("images") or []: + # Linked last to first: every workspace list shows a prompt's media + # newest link first, so the record's first image (the LoRA cover, + # #355) is the one a Library card shows. + for image in reversed(record.get("images") or []): if self._insert_image_link(conn, prompt_id, image): result["images"] += 1 result["rows"].append({"name": name, "outcome": outcome})