Files
TeleWave/backend/src/TeleWave.Application/Broadcast/Bumpers/BumperSpecFactory.cs
T
Leonid Pershin 6be373476c
ci / build-backend (push) Successful in 2m14s
ci / build-frontend (push) Successful in 49s
ci / tests (push) Successful in 2m7s
ci / sonar (push) Successful in 7m39s
Implement background clip functionality for bumpers
Enhanced the bumper system to support a new background type, 'Clip', allowing text to be overlaid on existing video clips. This update includes the addition of a BackgroundClipShowId property in various records and classes, ensuring that the clip's duration dictates the bumper length. Updated validation rules, mapping, and rendering logic to accommodate this new feature. Localization strings were also updated to reflect the new background option and its implications for audio handling.
2026-07-29 23:54:11 +03:00

37 lines
1.5 KiB
C#

using TeleWave.Application.Common.Interfaces;
using TeleWave.Domain.Broadcast;
namespace TeleWave.Application.Broadcast.Bumpers;
/// <summary>
/// Чистая сборка <see cref="BumperRenderSpec"/> из уже разрешённых входов (готовые строки, пути к
/// постеру/фону/звуку). Общая точка для фонового рендерера заставок расписания и превью в админке.
/// </summary>
public static class BumperSpecFactory
{
public static BumperRenderSpec Build(
BumperOptions bumper,
BumperTemplate template,
int alignedDurationSeconds,
BumperSpecInputs inputs
) =>
new(
alignedDurationSeconds,
bumper.Width,
bumper.Height,
template.BackgroundColor,
template.BackgroundColor2,
template.AccentColor,
template.TextColor,
template.Font == BumperFont.Serif ? bumper.FontFileSerif : bumper.FontFileSans,
inputs.Lines,
inputs.BackgroundAbsolutePath,
inputs.AudioPath,
inputs.PosterAbsolutePath,
inputs.ClipAbsolutePath,
// Джингл назначен — он и звучит, подрезанный под ролик; не назначен — играет
// оригинальная дорожка ролика.
UseClipAudio: inputs.ClipAbsolutePath is not null && inputs.AudioPath is null
);
}