fc-3g-ext: IR Post/Provenance restore (tag_apply phase 4) + modal artist fallback
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -237,6 +237,15 @@ class GalleryService:
|
||||
)
|
||||
tags = (await self.session.execute(tag_stmt)).scalars().all()
|
||||
neighbors = await self._neighbors(record)
|
||||
# Direct artist FK — used by the modal's ProvenancePanel as a
|
||||
# fallback when ImageProvenance is empty (i.e., filesystem-
|
||||
# imported images without a post-track provenance row). The
|
||||
# source of truth for richer post-level data is still
|
||||
# ImageProvenance/Post; this is just the "we at least know who
|
||||
# made it" line.
|
||||
artist = None
|
||||
if record.artist_id is not None:
|
||||
artist = await self.session.get(Artist, record.artist_id)
|
||||
return {
|
||||
"id": record.id,
|
||||
"path": record.path,
|
||||
@@ -249,6 +258,10 @@ class GalleryService:
|
||||
"created_at": record.created_at.isoformat(),
|
||||
"thumbnail_url": thumbnail_url(record.sha256, record.mime),
|
||||
"image_url": f"/images/{record.path.split('/images/', 1)[-1]}",
|
||||
"artist": (
|
||||
{"id": artist.id, "name": artist.name, "slug": artist.slug}
|
||||
if artist is not None else None
|
||||
),
|
||||
"tags": [
|
||||
{
|
||||
"id": t.id,
|
||||
|
||||
Reference in New Issue
Block a user