fix: resolve gallery labels from current plans and preserve render snapshots
This commit is contained in:
@@ -812,6 +812,10 @@ def create_app(settings=None, start_worker=True):
|
||||
with service.lock:
|
||||
service.libraries.check_source_delete(source_id)
|
||||
service.photo_sources.delete(source_id)
|
||||
db.execute(
|
||||
"DELETE FROM library_plans WHERE source_id=? AND archived=1",
|
||||
(source_id,),
|
||||
)
|
||||
return Response(status_code=204)
|
||||
|
||||
@app.get(
|
||||
|
||||
@@ -284,12 +284,14 @@ def install_libraries(app, service):
|
||||
# Offline devices must not hide locally generated versions.
|
||||
pass
|
||||
items = []
|
||||
versions_by_picture = {}
|
||||
for row in rows:
|
||||
version = next(
|
||||
v
|
||||
for v in libraries.versions(row["source_image_id"])
|
||||
if v["asset_id"] == row["asset_id"]
|
||||
)
|
||||
picture_id = row["source_image_id"]
|
||||
if picture_id not in versions_by_picture:
|
||||
versions_by_picture[picture_id] = {
|
||||
v["asset_id"]: v for v in libraries.versions(picture_id)
|
||||
}
|
||||
version = versions_by_picture[picture_id][row["asset_id"]]
|
||||
delivery = db.one(
|
||||
"SELECT operation_id FROM terminal_deliveries WHERE terminal_id=? AND asset_id=? ORDER BY created_at DESC,operation_id DESC LIMIT 1",
|
||||
(terminal_id, row["asset_id"]),
|
||||
|
||||
Reference in New Issue
Block a user