fix(app): bound deco template item times to a single day (#144 S4 review)
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m19s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m29s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped

Out-of-range TimeSpans (25:00:00, 1.06:00:00, negatives) previously
persisted raw while the read side projected .TimeOfDay, so display and
playout behavior diverged silently.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 20:00:48 +02:00
co-authored by Claude Fable 5
parent 0d9504c16b
commit c745d01a2c
@@ -99,6 +99,13 @@ public class ReplaceDecoTemplateItemsHandler(IDbContextFactory<TvContext> dbCont
foreach (DecoTemplateItemRange item in itemsWithEffectiveEnd)
{
if (item.StartTime < TimeSpan.Zero || item.StartTime >= TimeSpan.FromHours(24) ||
item.EndTime < TimeSpan.Zero || item.EndTime > TimeSpan.FromHours(24))
{
return BaseError.New(
$"Deco from {item.StartTime} to {item.EndTime} must be within a single day (00:00 to 24:00)");
}
if (item.StartTime >= item.EffectiveEndTime)
{
return BaseError.New(