Browse Source

fix playout time zone bugs (#60)

* fix time zone bugs with playout building

* more time zone fixes
pull/61/head
Jason Dove 5 years ago committed by GitHub
parent
commit
c016cac8d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ErsatzTV.Core/Scheduling/PlayoutBuilder.cs

8
ErsatzTV.Core/Scheduling/PlayoutBuilder.cs

@ -106,7 +106,7 @@ namespace ErsatzTV.Core.Scheduling @@ -106,7 +106,7 @@ namespace ErsatzTV.Core.Scheduling
PlayoutAnchor startAnchor = FindStartAnchor(playout, playoutStart, sortedScheduleItems);
// start at the previously-decided time
DateTimeOffset currentTime = startAnchor.NextStart;
DateTimeOffset currentTime = startAnchor.NextStartOffset.ToLocalTime();
_logger.LogDebug(
"Starting playout {PlayoutId} for channel {ChannelNumber} - {ChannelName} at {StartTime}",
playout.Id,
@ -277,7 +277,7 @@ namespace ErsatzTV.Core.Scheduling @@ -277,7 +277,7 @@ namespace ErsatzTV.Core.Scheduling
playout.ProgramScheduleAnchors = BuildProgramScheduleAnchors(playout, collectionEnumerators);
// remove any items outside the desired range
playout.Items.RemoveAll(old => old.Finish < playoutStart || old.Start > playoutFinish);
playout.Items.RemoveAll(old => old.FinishOffset < playoutStart || old.StartOffset > playoutFinish);
return playout;
}
@ -297,7 +297,7 @@ namespace ErsatzTV.Core.Scheduling @@ -297,7 +297,7 @@ namespace ErsatzTV.Core.Scheduling
{
NextScheduleItem = schedule,
NextScheduleItemId = schedule.Id,
NextStart = start.Date + schedule.StartTime.GetValueOrDefault()
NextStart = (start - start.TimeOfDay).UtcDateTime + schedule.StartTime.GetValueOrDefault()
};
case StartType.Dynamic:
default:
@ -305,7 +305,7 @@ namespace ErsatzTV.Core.Scheduling @@ -305,7 +305,7 @@ namespace ErsatzTV.Core.Scheduling
{
NextScheduleItem = schedule,
NextScheduleItemId = schedule.Id,
NextStart = start.Date
NextStart = (start - start.TimeOfDay).UtcDateTime
};
}
});

Loading…
Cancel
Save