Make collage selection automatic and restore dashboard navigation order

This commit is contained in:
Pigway
2026-10-10 09:28:37 +08:00
parent cc4126d23c
commit a869f0b042
17 changed files with 452 additions and 13 deletions
+12
View File
@@ -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(