fix: persist product archive cover and provenance
This commit is contained in:
@@ -1110,11 +1110,6 @@ async def create_product_version(
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc)) from exc
|
||||
|
||||
source_job_ids = [
|
||||
str(source.get("source_job_id") or "")
|
||||
for source in version.metadata.get("wordcloud_sources", [])
|
||||
if isinstance(source, dict)
|
||||
]
|
||||
rows = product_archive_store._fetchall(
|
||||
"SELECT * FROM product_wordcloud_archives WHERE version_id = ? ORDER BY created_at, archive_id",
|
||||
(version.version_id,),
|
||||
@@ -1126,10 +1121,12 @@ async def create_product_version(
|
||||
"version_id": row["version_id"],
|
||||
"archive_path": row["archive_path"],
|
||||
"created_at": datetime.fromisoformat(row["created_at"]),
|
||||
"source_job_id": source_job_id,
|
||||
"source_job_id": row["source_job_id"],
|
||||
"source_asset_id": row["source_asset_id"],
|
||||
"db_checksum": row["db_checksum"],
|
||||
"db_path": row["archive_path"],
|
||||
}
|
||||
for source_job_id, row in zip(source_job_ids, rows, strict=True)
|
||||
for row in rows
|
||||
]
|
||||
return ProductVersionArchiveResponse(
|
||||
**version.model_dump(),
|
||||
|
||||
Reference in New Issue
Block a user