fix: complete display and channel group management

This commit is contained in:
ekklesia
2026-09-29 18:15:26 -05:00
parent 5760059ee3
commit aa8cb1c96f
10 changed files with 243 additions and 19 deletions
+14
View File
@@ -46,6 +46,20 @@ export function createMemorySignageStore(
...playbackStore,
...viewerStore,
async deleteChannelGroup(groupId: string, fallbackChannelId: string): Promise<void> {
const removedChannelIds = new Set(
[...playbackStore.channels.values()]
.filter((channel) => channel.groupId === groupId)
.map((channel) => channel.id),
);
for (const viewer of viewerStore.viewers.values()) {
if (viewer.channelId !== null && removedChannelIds.has(viewer.channelId)) {
await viewerStore.updateViewer(viewer.id, { channelId: fallbackChannelId });
}
}
await playbackStore.deleteChannelGroup(groupId, fallbackChannelId);
},
addImageReference(imageId: string, kind: "slot" | "static-hold"): void {
const current = references.get(imageId) ?? { slots: 0, staticHolds: 0 };
references.set(