Make collage selection automatic and restore dashboard navigation order
This commit is contained in:
@@ -23,7 +23,7 @@ class CloudLibrary:
|
||||
job_id = (
|
||||
job["job_id"]
|
||||
if job
|
||||
and content.get("type") == "photo_source"
|
||||
and content.get("type") in ("photo_source", "auto_collage")
|
||||
and content.get("item_id") is None
|
||||
else None
|
||||
)
|
||||
|
||||
@@ -11,6 +11,7 @@ from pigway_frame_flow.drivers.base import DriverRegistry
|
||||
from pigway_frame_flow.errors import ErrorCode as E
|
||||
from pigway_frame_flow.errors import FlowError
|
||||
from pigway_frame_flow.models import (
|
||||
AutoCollageContent,
|
||||
DisplayRequest,
|
||||
FutureContent,
|
||||
ImageContent,
|
||||
@@ -81,6 +82,11 @@ class DisplayService:
|
||||
) from None
|
||||
for region in plan.regions:
|
||||
self.assets.path(region.asset_id)
|
||||
if (
|
||||
isinstance(request.content, AutoCollageContent)
|
||||
and request.content.source_id
|
||||
):
|
||||
self.photo_sources.get(request.content.source_id)
|
||||
if isinstance(request.content, PhotoSourceContent):
|
||||
self.photo_sources.get(request.content.source_id)
|
||||
if writing and not self.settings.mock and not self.settings.write_enabled:
|
||||
@@ -191,6 +197,12 @@ class DisplayService:
|
||||
return self.db.one("SELECT * FROM device_state WHERE device_id=?", (id,))
|
||||
|
||||
def content_asset(self, content, device_id=None, operation_id=None):
|
||||
if isinstance(content, AutoCollageContent):
|
||||
from pigway_frame_flow.extensions.auto_collage import prepare
|
||||
|
||||
return self.content_asset(
|
||||
prepare(self, content, device_id), device_id, operation_id
|
||||
)
|
||||
if isinstance(content, ProviderContent):
|
||||
values = {**content.data, **self.providers.get(content.provider_id)}
|
||||
return self.content_asset(
|
||||
|
||||
Reference in New Issue
Block a user