|
|
|
@ -56,14 +56,29 @@ public class BlockPlayoutBuilder( |
|
|
|
BlockPlayoutChangeDetection.RemoveItemAndHistory(playout, playoutItem); |
|
|
|
BlockPlayoutChangeDetection.RemoveItemAndHistory(playout, playoutItem); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTimeOffset currentTime = start; |
|
|
|
|
|
|
|
|
|
|
|
foreach (EffectiveBlock effectiveBlock in updatedEffectiveBlocks) |
|
|
|
foreach (EffectiveBlock effectiveBlock in updatedEffectiveBlocks) |
|
|
|
{ |
|
|
|
{ |
|
|
|
logger.LogDebug( |
|
|
|
if (currentTime < effectiveBlock.Start) |
|
|
|
"Will schedule block {Block} at {Start}", |
|
|
|
{ |
|
|
|
effectiveBlock.Block.Name, |
|
|
|
currentTime = effectiveBlock.Start; |
|
|
|
effectiveBlock.Start); |
|
|
|
|
|
|
|
|
|
|
|
logger.LogDebug( |
|
|
|
|
|
|
|
"Will schedule block {Block} at {Start}", |
|
|
|
|
|
|
|
effectiveBlock.Block.Name, |
|
|
|
|
|
|
|
effectiveBlock.Start); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
logger.LogDebug( |
|
|
|
|
|
|
|
"Will schedule block {Block} with start {Start} at {ActualStart}", |
|
|
|
|
|
|
|
effectiveBlock.Block.Name, |
|
|
|
|
|
|
|
effectiveBlock.Start, |
|
|
|
|
|
|
|
currentTime); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DateTimeOffset currentTime = effectiveBlock.Start; |
|
|
|
DateTimeOffset blockFinish = effectiveBlock.Start.AddMinutes(effectiveBlock.Block.Minutes); |
|
|
|
|
|
|
|
|
|
|
|
foreach (BlockItem blockItem in effectiveBlock.Block.Items.OrderBy(i => i.Index)) |
|
|
|
foreach (BlockItem blockItem in effectiveBlock.Block.Items.OrderBy(i => i.Index)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -73,6 +88,17 @@ public class BlockPlayoutBuilder( |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentTime >= blockFinish) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
logger.LogDebug( |
|
|
|
|
|
|
|
"Current time {Time} for block {Block} is beyond block finish {Finish}; will stop with this block's items", |
|
|
|
|
|
|
|
currentTime, |
|
|
|
|
|
|
|
effectiveBlock.Block.Name, |
|
|
|
|
|
|
|
blockFinish); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// check for playout history for this collection
|
|
|
|
// check for playout history for this collection
|
|
|
|
string historyKey = HistoryDetails.KeyForBlockItem(blockItem); |
|
|
|
string historyKey = HistoryDetails.KeyForBlockItem(blockItem); |
|
|
|
//logger.LogDebug("History key for block item {Item} is {Key}", blockItem.Id, historyKey);
|
|
|
|
//logger.LogDebug("History key for block item {Item} is {Key}", blockItem.Id, historyKey);
|
|
|
|
|