Enhance scheduling and trace functionalities: add CollectionId to ScheduleEntry and PlannedItem models, update related query handlers and frontend components to support collection information in entry traces. Improve data handling in scheduling logic and enhance user experience in trace display.
This commit is contained in:
@@ -333,7 +333,7 @@ public static class SchedulePlanner
|
||||
if (!WithinBudget(slot, placed, accumulated, cursor, unit, budgetEnd))
|
||||
break;
|
||||
|
||||
items.Add(Program(unit, cursor, slot.SlotId, slotTrace));
|
||||
items.Add(Program(unit, cursor, slot.SlotId, slotTrace, CollectionOf(element)));
|
||||
cursor += unit.Duration;
|
||||
accumulated += unit.Duration;
|
||||
unitIndex++;
|
||||
@@ -451,11 +451,16 @@ public static class SchedulePlanner
|
||||
return cursor;
|
||||
}
|
||||
|
||||
/// <summary>Коллекция элемента или null, если в эфир шло отдельное шоу.</summary>
|
||||
private static Guid? CollectionOf(PlanningElement element) =>
|
||||
element.Kind == GroupElementKind.Collection ? element.ElementId : null;
|
||||
|
||||
private static PlannedItem Program(
|
||||
PlanningUnit unit,
|
||||
DateTimeOffset start,
|
||||
Guid slotId,
|
||||
PlanTrace trace
|
||||
PlanTrace trace,
|
||||
Guid? collectionId = null
|
||||
) =>
|
||||
new(
|
||||
unit.MediaAssetId,
|
||||
@@ -465,7 +470,8 @@ public static class SchedulePlanner
|
||||
unit.UnitIndex,
|
||||
slotId,
|
||||
PlannedItemKind.Program,
|
||||
trace
|
||||
trace,
|
||||
CollectionId: collectionId
|
||||
);
|
||||
|
||||
private static PlanningCursorUpdate CursorUpdate(
|
||||
|
||||
Reference in New Issue
Block a user