fix changing default alternate schedule (#2331)

This commit is contained in:
Jason Dove
2025-08-18 15:37:21 +00:00
committed by GitHub
parent 31c18162e1
commit 988ed8db04
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -75,6 +75,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix incorrect media item counts after removing paths from local libraries
- Fix song playback in playback troubleshooting
- Fix seeking into extracted text subtitles
- Fix error when changing default (lowest priority) alternate schedule
### Changed
- Allow multiple watermarks in playback troubleshooting
@@ -112,13 +112,19 @@ public class ReplacePlayoutAlternateScheduleItemsHandler :
}
// save highest index directly to playout
if (playout.ProgramScheduleId != highest.ProgramScheduleId)
bool hasDefaultScheduleChange = playout.ProgramScheduleId != highest.ProgramScheduleId;
if (hasDefaultScheduleChange)
{
playout.ProgramScheduleId = highest.ProgramScheduleId;
}
await dbContext.SaveChangesAsync(cancellationToken);
if (hasDefaultScheduleChange)
{
await dbContext.Entry(playout).Reference(p => p.ProgramSchedule).LoadAsync(cancellationToken);
}
// load newly-added schedules
foreach (ProgramScheduleAlternate alternate in playout.ProgramScheduleAlternates
.Where(alternate => alternate.ProgramSchedule is null))