From a194bef56d6ba8651591ca669970ae6034493cff Mon Sep 17 00:00:00 2001 From: AML - A Laycock Date: Thu, 4 Jun 2026 08:51:17 +0100 Subject: [PATCH 1/2] fix: copy audio sequence as well, and correctly handle default as null, closes #25 --- app/routes/days.add.tsx | 17 +++++++++++++---- app/routes/schedule._index.tsx | 6 ++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/routes/days.add.tsx b/app/routes/days.add.tsx index 04433f6..da044d8 100644 --- a/app/routes/days.add.tsx +++ b/app/routes/days.add.tsx @@ -62,13 +62,22 @@ export const action = async ({request}: ActionFunctionArgs) => { if (copyFrom !== '-') { const schedules = await prisma.schedule.findMany({ - where: {dayTypeId: copyFrom === '_' ? undefined : copyFrom} + where: {dayTypeId: copyFrom === '_' ? null : copyFrom} }) await prisma.schedule.createMany({ - data: schedules.map(({time, weekDays, zoneId, audioId}) => { - return {dayTypeId: dayType.id, time, weekDays, zoneId, audioId} - }) + data: schedules.map( + ({time, weekDays, zoneId, audioId, audioSequence}) => { + return { + dayTypeId: dayType.id, + time, + weekDays, + zoneId, + audioId, + audioSequence + } + } + ) }) } diff --git a/app/routes/schedule._index.tsx b/app/routes/schedule._index.tsx index b584797..91b822b 100644 --- a/app/routes/schedule._index.tsx +++ b/app/routes/schedule._index.tsx @@ -30,7 +30,7 @@ export const loader = async ({request}: LoaderFunctionArgs) => { const schedules = await prisma.schedule.findMany({ orderBy: {time: 'asc'}, - include: {zone: true, audio: true} + include: {zone: true} }) const days = await prisma.dayType.findMany({ @@ -116,7 +116,9 @@ const Schedule = () => { {zone.name} - {(JSON.parse(audioSequence) as string[]).length} + {audioSequence === '' + ? 0 + : (JSON.parse(audioSequence) as string[]).length}
From 312af86a3e8b28ff460d72988eb6d6b7681dc090 Mon Sep 17 00:00:00 2001 From: AML - A Laycock Date: Thu, 4 Jun 2026 08:52:06 +0100 Subject: [PATCH 2/2] version: bump to 1.6.2 --- app/lib/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/constants.ts b/app/lib/constants.ts index f46ad68..c3ba4dd 100644 --- a/app/lib/constants.ts +++ b/app/lib/constants.ts @@ -1,4 +1,4 @@ -export const VERSION = '1.6.1' +export const VERSION = '1.6.2' export const RequiredVersions = { controller: VERSION,