Browse Source

fix block playout epg time zone (#2166)

pull/2167/head
Jason Dove 10 months ago committed by GitHub
parent
commit
e0cef62969
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 13
      ErsatzTV.Application/Channels/Commands/RefreshChannelDataHandler.cs
  3. 4
      ErsatzTV.Core.Tests/Scheduling/MultiPartEpisodeGrouperTests.cs

1
CHANGELOG.md

@ -138,6 +138,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -138,6 +138,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix VAAPI tonemap failure
- Fix green bars after VAAPI tonemap
- Fix bug where playout mode `Multiple` would ignore fixed start time
- Fix block playout EPG generation to use XMLTV Time Zone setting
## [25.2.0] - 2025-06-24
### Added

13
ErsatzTV.Application/Channels/Commands/RefreshChannelDataHandler.cs

@ -346,7 +346,7 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> @@ -346,7 +346,7 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData>
}
}
private static async Task WriteBlockPlayoutXml(
private async Task WriteBlockPlayoutXml(
RefreshChannelData request,
List<PlayoutItem> sorted,
XmlTemplateContext templateContext,
@ -358,6 +358,10 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> @@ -358,6 +358,10 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData>
XmlMinifier minifier,
XmlWriter xml)
{
XmltvTimeZone xmltvTimeZone = await _configElementRepository
.GetValue<XmltvTimeZone>(ConfigElementKey.XmltvTimeZone)
.IfNoneAsync(XmltvTimeZone.Local);
var groups = sorted.GroupBy(s => new { s.GuideStart, s.GuideFinish, s.GuideGroup });
foreach (var group in groups)
{
@ -373,7 +377,12 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData> @@ -373,7 +377,12 @@ public class RefreshChannelDataHandler : IRequestHandler<RefreshChannelData>
TimeSpan perItem = groupDuration / itemsToInclude.Count;
DateTimeOffset currentStart = new DateTimeOffset(groupStart, TimeSpan.Zero).ToLocalTime();
DateTimeOffset currentStart = xmltvTimeZone switch
{
XmltvTimeZone.Utc => new DateTimeOffset(groupStart, TimeSpan.Zero),
_ => new DateTimeOffset(groupStart, TimeSpan.Zero).ToLocalTime()
};
DateTimeOffset currentFinish = currentStart + perItem;
foreach (PlayoutItem item in itemsToInclude)

4
ErsatzTV.Core.Tests/Scheduling/MultiPartEpisodeGrouperTests.cs

@ -57,7 +57,9 @@ public class MultiPartEpisodeGrouperTests @@ -57,7 +57,9 @@ public class MultiPartEpisodeGrouperTests
[Test]
[TestCase("The Meddlers (Part One)", "The Meddlers (Part Two)", "The Meddlers (Part Three)")]
[TestCase("S01E01 The Slaves of Jedikiah, Part 1", "S01E02 The Slaves of Jedikiah, Part 2", "S01E03 The Slaves of Jedikiah, Part 3")]
[TestCase("The Slaves of Jedikiah, Part 1", "The Slaves of Jedikiah, Part 2", "The Slaves of Jedikiah, Part 3")]
[TestCase("An Unearthly Child: An Unearthly Child (1)", "An Unearthly Child: The Cave of Skulls (2)", "An Unearthly Child: The Forest of Fear (3)")]
[TestCase("The Savages (1)", "The Savages (2)", "The Savages (3)")]
public void All_Grouped(string one, string two, string three)
{
var mediaItems = new List<MediaItem>

Loading…
Cancel
Save