Browse Source

fix classic schedule start time calculation across a UTC offset change (#2593)

* fix classic schedule start time calculation across a UTC offset change

* update changelog
pull/2594/head
Jason Dove 9 months ago committed by GitHub
parent
commit
89133255d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      CHANGELOG.md
  2. 20
      ErsatzTV.Core/Scheduling/PlayoutModeSchedulerBase.cs

3
CHANGELOG.md

@ -22,8 +22,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -22,8 +22,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Properly set explicit audio decoder on combined audio and video input file
- Fix building sequential schedules across a UTC offset change
- Fix block start time calculation across a UTC offset change
- Fix classic schedule start time calculation across a UTC offset change
- Fix XMLTV generation for channels using on-demand playout mode
- Fix some removed songs from appearing in the trash
- Fix some file not found songs missing from trash view
### Changed
- Use smaller batch size for search index updates (100, down from 1000)

20
ErsatzTV.Core/Scheduling/PlayoutModeSchedulerBase.cs

@ -60,16 +60,16 @@ public abstract class PlayoutModeSchedulerBase<T>(ILogger logger) : IPlayoutMode @@ -60,16 +60,16 @@ public abstract class PlayoutModeSchedulerBase<T>(ILogger logger) : IPlayoutMode
TimeSpan itemStartTime = scheduleItem.StartTime.GetValueOrDefault();
DateTime date = startTime.Date;
DateTimeOffset result = new DateTimeOffset(
date.Year,
date.Month,
date.Day,
0,
0,
0,
TimeZoneInfo.Local.GetUtcOffset(
new DateTime(date.Year, date.Month, date.Day, 0, 0, 0, DateTimeKind.Local)))
.Add(itemStartTime);
var withStartTime = new DateTime(
date.Year,
date.Month,
date.Day,
0,
0,
0,
DateTimeKind.Unspecified).Add(itemStartTime);
DateTimeOffset result = new DateTimeOffset(withStartTime, TimeZoneInfo.Local.GetUtcOffset(withStartTime));
// Serilog.Log.Logger.Debug(
// "StartTimeOfDay: {StartTimeOfDay} Item Start Time: {ItemStartTime}",

Loading…
Cancel
Save