Keep manual redisplays separate from random task cloud heads
This commit is contained in:
@@ -12,14 +12,28 @@ class CloudLibrary:
|
||||
self.checked = 0.0
|
||||
|
||||
def register(self, device_id, image_id, asset_id, operation_id):
|
||||
meta = self.service.assets.info(asset_id)
|
||||
operation = self.db.one(
|
||||
"SELECT payload FROM operations WHERE id=?", (operation_id,)
|
||||
)
|
||||
payload = json.loads(operation["payload"])
|
||||
content = payload.get("content", {})
|
||||
job = self.db.one(
|
||||
"SELECT job_id FROM job_runs WHERE operation_id=?", (operation_id,)
|
||||
)
|
||||
job_id = (
|
||||
job["job_id"]
|
||||
if job
|
||||
and content.get("type") == "photo_source"
|
||||
and content.get("item_id") is None
|
||||
else None
|
||||
)
|
||||
self.db.execute(
|
||||
"INSERT INTO managed_cloud_uploads VALUES(?,?,?,?,?,?,NULL,NULL)",
|
||||
(
|
||||
device_id,
|
||||
image_id,
|
||||
asset_id,
|
||||
meta.get("job_id"),
|
||||
job_id,
|
||||
operation_id,
|
||||
datetime.now(UTC).isoformat(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user