Refactor various components to improve code clarity and maintainability. Update ListUsersQueryHandler to utilize UserListFilter for parameter handling. Refactor BumperSpecFactory and related classes to encapsulate input parameters into dedicated records, enhancing readability. Adjust MediaAsset and Slot classes to streamline content updates with new content models. Improve BumperRenderBackgroundService and MediaProcessingBackgroundService to use MediaReadyInfo for asset readiness, ensuring consistent parameter management across the application.
ci / build-backend (push) Successful in 1m55s
ci / build-frontend (push) Successful in 45s
ci / tests (push) Successful in 2m33s
ci / sonar (push) Successful in 6m28s

This commit is contained in:
Leonid Pershin
2026-07-27 00:56:04 +03:00
parent 419aff54fa
commit 19fa23b619
47 changed files with 556 additions and 423 deletions
+11 -22
View File
@@ -108,32 +108,21 @@ public class Slot
}
/// <summary>Правит наполнение слота: чем, в каком объёме и с какими врезками.</summary>
public void UpdateContent(
string title,
SlotKind slotKind,
Guid? groupId,
string? strategyJson,
string? repeatSourceJson,
SlotBlockMode blockMode,
int blockValue,
OverflowPolicy overflowPolicy,
Guid? junctionBetweenId = null,
Guid? junctionAfterId = null
)
public void UpdateContent(SlotContent content)
{
JunctionBetweenId = junctionBetweenId;
JunctionAfterId = junctionAfterId;
Title = title.Trim();
SlotKind = slotKind;
BlockMode = blockMode;
BlockValue = Math.Max(1, blockValue);
OverflowPolicy = overflowPolicy;
JunctionBetweenId = content.JunctionBetweenId;
JunctionAfterId = content.JunctionAfterId;
Title = content.Title.Trim();
SlotKind = content.SlotKind;
BlockMode = content.BlockMode;
BlockValue = Math.Max(1, content.BlockValue);
OverflowPolicy = content.OverflowPolicy;
// Поля, не относящиеся к типу слота, гасим: повтор и конец вещания стратегии не имеют,
// и оставленный от прежнего типа мусор потом читался бы генератором как настройка.
GroupId = slotKind == SlotKind.Content ? groupId : null;
StrategyJson = slotKind == SlotKind.Content ? strategyJson : null;
RepeatSourceJson = slotKind == SlotKind.Repeat ? repeatSourceJson : null;
GroupId = content.SlotKind == SlotKind.Content ? content.GroupId : null;
StrategyJson = content.SlotKind == SlotKind.Content ? content.StrategyJson : null;
RepeatSourceJson = content.SlotKind == SlotKind.Repeat ? content.RepeatSourceJson : null;
}
/// <summary>Конец слота в сутках канала. Может выйти за полночь — вещательные сутки длиннее суток.</summary>
@@ -0,0 +1,22 @@
namespace TeleWave.Domain.Programming;
/// <summary>
/// Наполнение слота: чем заполнять эфир, в каком объёме и с какими врезками. Отделено от расписания
/// слота (<see cref="Slot.UpdateTiming"/>) — это два независимых набора настроек, и правятся они
/// в редакторе тоже раздельно.
/// </summary>
public sealed record SlotContent(
string Title,
SlotKind SlotKind,
/// <summary>Группа контента — только для <see cref="SlotKind.Content"/>, иначе гасится.</summary>
Guid? GroupId,
string? StrategyJson,
string? RepeatSourceJson,
SlotBlockMode BlockMode,
int BlockValue,
OverflowPolicy OverflowPolicy,
/// <summary>Стык между единицами внутри блока (null — врезок внутри блока нет).</summary>
Guid? JunctionBetweenId = null,
/// <summary>Стык в конце блока (null — берётся стык шаблона по умолчанию).</summary>
Guid? JunctionAfterId = null
);