Enhance channel management: add support for preferred weight multipliers and preferred hours in channel shows, update related data models and API endpoints, and implement validation for new properties. Refactor scheduling logic to utilize preferred hours for weight adjustments during show planning.

This commit is contained in:
Leonid Pershin
2026-07-25 18:44:28 +03:00
parent 358adbff21
commit 8718e8b6bf
36 changed files with 2921 additions and 97 deletions
@@ -24,8 +24,13 @@ public class BumperTextVariant
public BumperTrigger Trigger { get; private set; }
/// <summary>Вес при стратегии <see cref="BumperSelection.WeightedRandom"/> (0 — не выбирается). Иначе игнорируется.</summary>
public int Weight { get; private set; } = DefaultWeight;
public DateTimeOffset CreatedAt { get; private set; }
public const int DefaultWeight = 1;
public const string DefaultNowLabel = "СЕЙЧАС";
public const string DefaultNextLabel = "ДАЛЕЕ";
@@ -49,6 +54,7 @@ public class BumperTextVariant
Line1 = string.Empty,
Line2 = string.Empty,
Trigger = trigger,
Weight = DefaultWeight,
CreatedAt = DateTimeOffset.UtcNow,
};
@@ -59,7 +65,8 @@ public class BumperTextVariant
string nextLabel,
string line1,
string line2,
BumperTrigger trigger
BumperTrigger trigger,
int weight
)
{
Name = name;
@@ -69,6 +76,7 @@ public class BumperTextVariant
Line1 = line1;
Line2 = line2;
Trigger = trigger;
Weight = Math.Max(0, weight);
}
/// <summary>Подходит ли подблок для перехода: <paramref name="isShowChange"/> — сменилось ли шоу.</summary>