Browse Source

add `advance` option to `epg_group` yaml playout instruction (#1942)

pull/1943/head
Jason Dove 9 months ago committed by GitHub
parent
commit
37ceac5651
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      CHANGELOG.md
  2. 3
      ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutEpgGroupHandler.cs
  3. 2
      ErsatzTV.Core/Scheduling/YamlScheduling/Models/YamlPlayoutEpgGroupInstruction.cs
  4. 19
      ErsatzTV.Core/Scheduling/YamlScheduling/YamlPlayoutContext.cs

5
CHANGELOG.md

@ -6,8 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -6,8 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- Add `Reset All Playouts` button to top of playouts page
- Add `rewind_on_reset` option to `wait_until` YAML playout instruction to allow
- Add `rewind_on_reset` option to `wait_until` YAML playout instruction
- This option allows YAML playouts to start in the past
- Add `advance` option to `epg_group` YAML playout instruction
- When set to `false`, this option will lock the guide group without starting a new guide group
- This can be helpful for "post roll" items that should be part of the previous item's guide group
### Changed
- **BREAKING CHANGE**: Change channel identifiers used in XMLTV to work around bad behavior in Plex

3
ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutEpgGroupHandler.cs

@ -21,7 +21,8 @@ public class YamlPlayoutEpgGroupHandler : IYamlPlayoutHandler @@ -21,7 +21,8 @@ public class YamlPlayoutEpgGroupHandler : IYamlPlayoutHandler
if (epgGroup.EpgGroup)
{
context.LockGuideGroup();
// advance guide group by default
context.LockGuideGroup(epgGroup.Advance is null or true);
}
else
{

2
ErsatzTV.Core/Scheduling/YamlScheduling/Models/YamlPlayoutEpgGroupInstruction.cs

@ -6,4 +6,6 @@ public class YamlPlayoutEpgGroupInstruction : YamlPlayoutInstruction @@ -6,4 +6,6 @@ public class YamlPlayoutEpgGroupInstruction : YamlPlayoutInstruction
{
[YamlMember(Alias = "epg_group", ApplyNamingConventions = false)]
public bool EpgGroup { get; set; }
public bool? Advance { get; set; }
}

19
ErsatzTV.Core/Scheduling/YamlScheduling/YamlPlayoutContext.cs

@ -8,6 +8,7 @@ public class YamlPlayoutContext(Playout playout, YamlPlayoutDefinition definitio @@ -8,6 +8,7 @@ public class YamlPlayoutContext(Playout playout, YamlPlayoutDefinition definitio
private readonly System.Collections.Generic.HashSet<int> _visitedInstructions = [];
private int _instructionIndex;
private bool _guideGroupLocked;
private int _guideGroup = guideGroup;
public Playout Playout { get; } = playout;
@ -31,21 +32,25 @@ public class YamlPlayoutContext(Playout playout, YamlPlayoutDefinition definitio @@ -31,21 +32,25 @@ public class YamlPlayoutContext(Playout playout, YamlPlayoutDefinition definitio
{
if (_guideGroupLocked)
{
return guideGroup;
return _guideGroup;
}
guideGroup++;
if (guideGroup > 1000)
_guideGroup++;
if (_guideGroup > 1000)
{
guideGroup = 1;
_guideGroup = 1;
}
return guideGroup;
return _guideGroup;
}
public void LockGuideGroup()
public void LockGuideGroup(bool advance = true)
{
NextGuideGroup();
if (advance)
{
NextGuideGroup();
}
_guideGroupLocked = true;
}

Loading…
Cancel
Save