fix block playout epg time zone (#2166)

This commit is contained in:
Jason Dove
2025-07-18 17:14:11 +00:00
committed by GitHub
parent 9e56f6552f
commit e0cef62969
3 changed files with 15 additions and 3 deletions
+1
View File
@@ -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
@@ -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>
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>
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)
@@ -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>