Browse Source

fix changing default alternate schedule (#2331)

pull/2332/head
Jason Dove 12 months ago committed by GitHub
parent
commit
988ed8db04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 8
      ErsatzTV.Application/Playouts/Commands/ReplacePlayoutAlternateScheduleItemsHandler.cs

1
CHANGELOG.md

@ -75,6 +75,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -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

8
ErsatzTV.Application/Playouts/Commands/ReplacePlayoutAlternateScheduleItemsHandler.cs

@ -112,13 +112,19 @@ public class ReplacePlayoutAlternateScheduleItemsHandler : @@ -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))

Loading…
Cancel
Save