show all items in epg by default (#1835)
This commit is contained in:
@@ -48,7 +48,7 @@ public class YamlPlayoutAllHandler(EnumeratorCache enumeratorCache) : YamlPlayou
|
||||
//PreferredAudioTitle = scheduleItem.PreferredAudioTitle,
|
||||
//PreferredSubtitleLanguageCode = scheduleItem.PreferredSubtitleLanguageCode,
|
||||
//SubtitleMode = scheduleItem.SubtitleMode
|
||||
GuideGroup = context.GuideGroup
|
||||
GuideGroup = context.NextGuideGroup()
|
||||
//GuideStart = effectiveBlock.Start.UtcDateTime,
|
||||
//GuideFinish = blockFinish.UtcDateTime,
|
||||
//BlockKey = JsonConvert.SerializeObject(effectiveBlock.BlockKey),
|
||||
|
||||
@@ -48,7 +48,7 @@ public class YamlPlayoutCountHandler(EnumeratorCache enumeratorCache) : YamlPlay
|
||||
//PreferredAudioTitle = scheduleItem.PreferredAudioTitle,
|
||||
//PreferredSubtitleLanguageCode = scheduleItem.PreferredSubtitleLanguageCode,
|
||||
//SubtitleMode = scheduleItem.SubtitleMode
|
||||
GuideGroup = context.GuideGroup
|
||||
GuideGroup = context.NextGuideGroup()
|
||||
//GuideStart = effectiveBlock.Start.UtcDateTime,
|
||||
//GuideFinish = blockFinish.UtcDateTime,
|
||||
//BlockKey = JsonConvert.SerializeObject(effectiveBlock.BlockKey),
|
||||
|
||||
@@ -51,7 +51,6 @@ public class YamlPlayoutDurationHandler(EnumeratorCache enumeratorCache) : YamlP
|
||||
duration.DiscardAttempts,
|
||||
duration.Trim,
|
||||
duration.OfflineTail,
|
||||
duration.EpgGroupPerItem,
|
||||
GetFillerKind(duration),
|
||||
enumerator,
|
||||
fallbackEnumerator);
|
||||
@@ -70,7 +69,6 @@ public class YamlPlayoutDurationHandler(EnumeratorCache enumeratorCache) : YamlP
|
||||
int discardAttempts,
|
||||
bool trim,
|
||||
bool offlineTail,
|
||||
bool guideGroupPerItem,
|
||||
FillerKind fillerKind,
|
||||
IMediaCollectionEnumerator enumerator,
|
||||
Option<IMediaCollectionEnumerator> fallbackEnumerator)
|
||||
@@ -81,11 +79,6 @@ public class YamlPlayoutDurationHandler(EnumeratorCache enumeratorCache) : YamlP
|
||||
{
|
||||
foreach (MediaItem mediaItem in enumerator.Current)
|
||||
{
|
||||
if (guideGroupPerItem)
|
||||
{
|
||||
context.GuideGroup *= -1;
|
||||
}
|
||||
|
||||
TimeSpan itemDuration = DurationForMediaItem(mediaItem);
|
||||
|
||||
var playoutItem = new PlayoutItem
|
||||
@@ -95,14 +88,13 @@ public class YamlPlayoutDurationHandler(EnumeratorCache enumeratorCache) : YamlP
|
||||
Finish = context.CurrentTime.UtcDateTime + itemDuration,
|
||||
InPoint = TimeSpan.Zero,
|
||||
OutPoint = itemDuration,
|
||||
GuideGroup = context.GuideGroup,
|
||||
GuideGroup = context.NextGuideGroup(),
|
||||
FillerKind = fillerKind
|
||||
//DisableWatermarks = !allowWatermarks
|
||||
};
|
||||
|
||||
if (remainingToFill - itemDuration >= TimeSpan.Zero)
|
||||
{
|
||||
|
||||
context.Playout.Items.Add(playoutItem);
|
||||
|
||||
// create history record
|
||||
|
||||
@@ -18,7 +18,7 @@ public class YamlPlayoutNewEpgGroupHandler : IYamlPlayoutHandler
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
context.GuideGroup *= -1;
|
||||
// context.NextGuideGroup() *= -1;
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ public class YamlPlayoutPadToNextHandler(EnumeratorCache enumeratorCache) : Yaml
|
||||
padToNext.DiscardAttempts,
|
||||
padToNext.Trim,
|
||||
offlineTail: true,
|
||||
guideGroupPerItem: false,
|
||||
GetFillerKind(padToNext),
|
||||
enumerator,
|
||||
fallbackEnumerator);
|
||||
|
||||
@@ -69,7 +69,6 @@ public class YamlPlayoutPadUntilHandler(EnumeratorCache enumeratorCache) : YamlP
|
||||
padUntil.DiscardAttempts,
|
||||
padUntil.Trim,
|
||||
offlineTail: true,
|
||||
guideGroupPerItem: false,
|
||||
GetFillerKind(padUntil),
|
||||
enumerator,
|
||||
fallbackEnumerator);
|
||||
|
||||
@@ -11,9 +11,6 @@ public class YamlPlayoutDurationInstruction : YamlPlayoutInstruction
|
||||
[YamlMember(Alias = "offline_tail", ApplyNamingConventions = false)]
|
||||
public bool OfflineTail { get; set; }
|
||||
|
||||
[YamlMember(Alias = "epg_group_per_item", ApplyNamingConventions = false)]
|
||||
public bool EpgGroupPerItem { get; set; } = true;
|
||||
|
||||
public string Fallback { get; set; }
|
||||
|
||||
[YamlMember(Alias = "discard_attempts", ApplyNamingConventions = false)]
|
||||
|
||||
@@ -37,10 +37,9 @@ public class YamlPlayoutBuilder(
|
||||
Dictionary<YamlPlayoutInstruction, IYamlPlayoutHandler> handlers = new();
|
||||
var enumeratorCache = new EnumeratorCache(mediaCollectionRepository);
|
||||
|
||||
var context = new YamlPlayoutContext(playout, playoutDefinition)
|
||||
var context = new YamlPlayoutContext(playout, playoutDefinition, guideGroup: 1)
|
||||
{
|
||||
CurrentTime = start,
|
||||
GuideGroup = 1
|
||||
CurrentTime = start
|
||||
|
||||
// no need to init default value and throw off visited count
|
||||
// InstructionIndex = 0
|
||||
@@ -61,10 +60,10 @@ public class YamlPlayoutBuilder(
|
||||
{
|
||||
foreach (PlayoutAnchor prevAnchor in Optional(playout.Anchor))
|
||||
{
|
||||
context.GuideGroup = prevAnchor.NextGuideGroup;
|
||||
// TODO: does this matter?
|
||||
//context.GuideGroup = prevAnchor.NextGuideGroup;
|
||||
|
||||
start = new DateTimeOffset(prevAnchor.NextStart.ToLocalTime(), start.Offset);
|
||||
context.CurrentTime = start;
|
||||
context.CurrentTime = new DateTimeOffset(prevAnchor.NextStart.ToLocalTime(), start.Offset);
|
||||
|
||||
context.InstructionIndex = prevAnchor.NextInstructionIndex;
|
||||
}
|
||||
@@ -171,7 +170,7 @@ public class YamlPlayoutBuilder(
|
||||
{
|
||||
NextStart = maxTime,
|
||||
NextInstructionIndex = context.InstructionIndex,
|
||||
NextGuideGroup = context.GuideGroup
|
||||
NextGuideGroup = context.NextGuideGroup()
|
||||
};
|
||||
|
||||
// logger.LogDebug(
|
||||
|
||||
@@ -3,7 +3,7 @@ using ErsatzTV.Core.Scheduling.YamlScheduling.Models;
|
||||
|
||||
namespace ErsatzTV.Core.Scheduling.YamlScheduling;
|
||||
|
||||
public class YamlPlayoutContext(Playout playout, YamlPlayoutDefinition definition)
|
||||
public class YamlPlayoutContext(Playout playout, YamlPlayoutDefinition definition, int guideGroup)
|
||||
{
|
||||
private readonly System.Collections.Generic.HashSet<int> _visitedInstructions = [];
|
||||
private int _instructionIndex;
|
||||
@@ -26,5 +26,14 @@ public class YamlPlayoutContext(Playout playout, YamlPlayoutDefinition definitio
|
||||
|
||||
public bool VisitedAll => _visitedInstructions.Count >= Definition.Playout.Count;
|
||||
|
||||
public int GuideGroup { get; set; }
|
||||
public int NextGuideGroup()
|
||||
{
|
||||
guideGroup++;
|
||||
if (guideGroup > 1000)
|
||||
{
|
||||
guideGroup = 1;
|
||||
}
|
||||
|
||||
return guideGroup;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user