feat: show original NAS photo paths in local gallery cards

This commit is contained in:
渡口浪人
2026-10-18 15:30:38 +08:00
parent a05260712e
commit 2af0aea2f6
10 changed files with 184 additions and 5 deletions
+18 -1
View File
@@ -392,7 +392,24 @@ class DisplayService:
"UPDATE operations SET result=? WHERE id=?",
(encode({"photo_attempts": attempts}), operation_id),
)
return self.assets.put(rendered, name, "cache" if staging else "images")
asset = self.assets.put(
rendered, name, "cache" if staging else "images"
)
self.db.execute(
"INSERT OR REPLACE INTO asset_sources VALUES(?,?)",
(
asset["asset_id"],
encode(
{
"type": "photo_source",
"source_id": content.source_id,
"item_id": item["id"],
"source_path": item.get("source_path"),
}
),
),
)
return self.assets.info(asset["asset_id"])
raise FlowError(
E.INVALID_REQUEST, "No decodable photo found within 5 candidates"
)