Refactor code formatting and improve readability: standardize line breaks and indentation across various endpoint files, enhancing code clarity and maintainability. Update package version formatting in Directory.Packages.props for consistency.
This commit is contained in:
@@ -57,7 +57,17 @@ public static class SchedulePlanner
|
||||
if (RollChance(chance, random))
|
||||
{
|
||||
var bumperStart = cursor;
|
||||
if (TryPlaceBumper(entries, bumper, prev, pick.ShowId, random, ref nextBumper, ref cursor))
|
||||
if (
|
||||
TryPlaceBumper(
|
||||
entries,
|
||||
bumper,
|
||||
prev,
|
||||
pick.ShowId,
|
||||
random,
|
||||
ref nextBumper,
|
||||
ref cursor
|
||||
)
|
||||
)
|
||||
lastBumperAt = bumperStart;
|
||||
}
|
||||
}
|
||||
@@ -115,8 +125,10 @@ public static class SchedulePlanner
|
||||
)
|
||||
{
|
||||
var isShowChange = fromShowId != toShowId;
|
||||
var eligible = bumper.Variants
|
||||
.Where(v => v.Duration > TimeSpan.Zero && MatchesTrigger(v.Trigger, isShowChange))
|
||||
var eligible = bumper
|
||||
.Variants.Where(v =>
|
||||
v.Duration > TimeSpan.Zero && MatchesTrigger(v.Trigger, isShowChange)
|
||||
)
|
||||
.ToList();
|
||||
if (eligible.Count == 0)
|
||||
return false;
|
||||
@@ -211,7 +223,10 @@ public static class SchedulePlanner
|
||||
var overridden = new List<(PlannerShow, int)>();
|
||||
foreach (var os in ovr.Shows)
|
||||
{
|
||||
if (!byShowId.TryGetValue(os.ShowId, out var show) || show.EpisodeAssetIds.Count == 0)
|
||||
if (
|
||||
!byShowId.TryGetValue(os.ShowId, out var show)
|
||||
|| show.EpisodeAssetIds.Count == 0
|
||||
)
|
||||
continue;
|
||||
var weight = ovr.Mode == OverrideMode.Exclusive ? 1 : os.Weight;
|
||||
if (weight > 0)
|
||||
@@ -224,8 +239,8 @@ public static class SchedulePlanner
|
||||
}
|
||||
|
||||
var hour = moment.UtcDateTime.Hour;
|
||||
return input.Shows
|
||||
.Where(s => s.Weight > 0 && s.EpisodeAssetIds.Count > 0)
|
||||
return input
|
||||
.Shows.Where(s => s.Weight > 0 && s.EpisodeAssetIds.Count > 0)
|
||||
.Select(s => (s, EffectiveWeight(s, hour)))
|
||||
.ToList();
|
||||
}
|
||||
@@ -318,7 +333,9 @@ public static class SchedulePlanner
|
||||
|
||||
for (var i = 0; i < input.AdsPerBreak; i++)
|
||||
{
|
||||
var assetId = input.AdPool[((nextAd % input.AdPool.Count) + input.AdPool.Count) % input.AdPool.Count];
|
||||
var assetId = input.AdPool[
|
||||
((nextAd % input.AdPool.Count) + input.AdPool.Count) % input.AdPool.Count
|
||||
];
|
||||
nextAd++;
|
||||
var end = cursor + DurationOf(assetId, input);
|
||||
entries.Add(new PlannedEntry(assetId, ScheduleEntryKind.Ad, cursor, end, null, null));
|
||||
|
||||
Reference in New Issue
Block a user