|
|
@ -53,7 +53,7 @@ public class YamlPlayoutApplyHistoryHandler(EnumeratorCache enumeratorCache) |
|
|
|
|
|
|
|
|
|
|
|
foreach (IMediaCollectionEnumerator enumerator in maybeEnumerator) |
|
|
|
foreach (IMediaCollectionEnumerator enumerator in maybeEnumerator) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (contentItem is YamlPlayoutContentMarathonItem marathonItem && enumerator is PlaylistEnumerator playlistEnumerator) |
|
|
|
if (enumerator is PlaylistEnumerator playlistEnumerator) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Option<PlayoutHistory> maybePrimaryHistory = maybeHistory |
|
|
|
Option<PlayoutHistory> maybePrimaryHistory = maybeHistory |
|
|
|
.Filter(h => string.IsNullOrWhiteSpace(h.ChildKey)) |
|
|
|
.Filter(h => string.IsNullOrWhiteSpace(h.ChildKey)) |
|
|
@ -61,16 +61,19 @@ public class YamlPlayoutApplyHistoryHandler(EnumeratorCache enumeratorCache) |
|
|
|
|
|
|
|
|
|
|
|
foreach (PlayoutHistory primaryHistory in maybePrimaryHistory) |
|
|
|
foreach (PlayoutHistory primaryHistory in maybePrimaryHistory) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool hasSetEnumeratorIndex = false; |
|
|
|
var hasSetEnumeratorIndex = false; |
|
|
|
|
|
|
|
|
|
|
|
if (!Enum.TryParse(marathonItem.ItemOrder, true, out PlaybackOrder itemPlaybackOrder)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
itemPlaybackOrder = PlaybackOrder.None; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var childEnumeratorKeys = playlistEnumerator.ChildEnumerators.Map(x => x.CollectionKey).ToList(); |
|
|
|
var childEnumeratorKeys = playlistEnumerator.ChildEnumerators.Map(x => x.CollectionKey).ToList(); |
|
|
|
foreach ((IMediaCollectionEnumerator childEnumerator, CollectionKey collectionKey) in playlistEnumerator.ChildEnumerators) |
|
|
|
foreach ((IMediaCollectionEnumerator childEnumerator, CollectionKey collectionKey) in playlistEnumerator.ChildEnumerators) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
PlaybackOrder itemPlaybackOrder = childEnumerator switch |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ChronologicalMediaCollectionEnumerator => PlaybackOrder.Chronological, |
|
|
|
|
|
|
|
RandomizedMediaCollectionEnumerator => PlaybackOrder.Random, |
|
|
|
|
|
|
|
ShuffledMediaCollectionEnumerator => PlaybackOrder.Shuffle, |
|
|
|
|
|
|
|
_ => PlaybackOrder.None |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
Option<PlayoutHistory> maybeApplicableHistory = maybeHistory |
|
|
|
Option<PlayoutHistory> maybeApplicableHistory = maybeHistory |
|
|
|
.Filter(h => h.ChildKey == HistoryDetails.KeyForCollectionKey(collectionKey)) |
|
|
|
.Filter(h => h.ChildKey == HistoryDetails.KeyForCollectionKey(collectionKey)) |
|
|
|
.HeadOrNone(); |
|
|
|
.HeadOrNone(); |
|
|
@ -99,8 +102,8 @@ public class YamlPlayoutApplyHistoryHandler(EnumeratorCache enumeratorCache) |
|
|
|
collectionItems, |
|
|
|
collectionItems, |
|
|
|
h.Details, |
|
|
|
h.Details, |
|
|
|
childEnumerator, |
|
|
|
childEnumerator, |
|
|
|
playbackOrder, |
|
|
|
itemPlaybackOrder, |
|
|
|
!h.IsCurrentChild); |
|
|
|
true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (h.IsCurrentChild) |
|
|
|
if (h.IsCurrentChild) |
|
|
@ -117,6 +120,10 @@ public class YamlPlayoutApplyHistoryHandler(EnumeratorCache enumeratorCache) |
|
|
|
// falling back to enumerator based on index
|
|
|
|
// falling back to enumerator based on index
|
|
|
|
playlistEnumerator.SetEnumeratorIndex(primaryHistory.Index); |
|
|
|
playlistEnumerator.SetEnumeratorIndex(primaryHistory.Index); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// only move next at the end, because that may also move
|
|
|
|
|
|
|
|
// the enumerator index
|
|
|
|
|
|
|
|
playlistEnumerator.MoveNext(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|