Browse Source

fix duration playout loop (#1796)

pull/1798/head
Jason Dove 1 year ago committed by GitHub
parent
commit
80ccbbf299
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      ErsatzTV.Core/Scheduling/PlayoutBuilder.cs
  3. 25
      ErsatzTV.Core/Scheduling/PlayoutModeSchedulerDuration.cs

1
CHANGELOG.md

@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix artwork in other video libraries by @raknam
- Fix adding items to empty playlists
- Fix filler preset editor and deco dead air fallback editor to only show supported collection types
- Fix infinite loop caused by impossible schedule (all collection items longer than schedule item duration)
### Changed
- Remove some unnecessary API calls related to media server scanning and paging

2
ErsatzTV.Core/Scheduling/PlayoutBuilder.cs

@ -666,7 +666,7 @@ public class PlayoutBuilder : IPlayoutBuilder @@ -666,7 +666,7 @@ public class PlayoutBuilder : IPlayoutBuilder
if (timeCount[playoutBuilderState.CurrentTime] == 6)
{
_logger.LogWarning(
"Failed to schedule beyond {Time}; aborting playout build - this is a bug",
"Failed to schedule beyond {Time}; aborting playout build - this can be caused by an impossible schedule, or by a bug",
playoutBuilderState.CurrentTime);
throw new InvalidOperationException("Scheduling loop encountered");

25
ErsatzTV.Core/Scheduling/PlayoutModeSchedulerDuration.cs

@ -77,6 +77,31 @@ public class PlayoutModeSchedulerDuration : PlayoutModeSchedulerBase<ProgramSche @@ -77,6 +77,31 @@ public class PlayoutModeSchedulerDuration : PlayoutModeSchedulerBase<ProgramSche
if (itemDuration > scheduleItem.PlayoutDuration)
{
var fail = false;
foreach (TimeSpan minimumDuration in contentEnumerator.MinimumDuration)
{
if (minimumDuration > scheduleItem.PlayoutDuration)
{
Logger.LogError(
"Collection with minimum duration {Duration:hh\\:mm\\:ss} will never fit in schedule item with duration {PlayoutDuration:hh\\:mm\\:ss}; skipping this schedule item!",
minimumDuration,
scheduleItem.PlayoutDuration);
nextState = nextState with
{
DurationFinish = None
};
nextState.ScheduleItemsEnumerator.MoveNext();
fail = true;
}
}
if (fail)
{
break;
}
Logger.LogWarning(
"Skipping playout item {Title} with duration {Duration:hh\\:mm\\:ss} that will never fit in schedule item duration {PlayoutDuration:hh\\:mm\\:ss}",
PlayoutBuilder.DisplayTitle(mediaItem),

Loading…
Cancel
Save