Refactor bumper template background management: rename background upload endpoint to reflect new functionality, update related command and handler to use image ID instead of extension, and adjust data models to support image references. Remove obsolete background handling code and enhance UI components for improved image selection and display.

This commit is contained in:
Leonid Pershin
2026-07-25 11:56:36 +03:00
parent a970eae7d2
commit 7efd616c29
35 changed files with 1227 additions and 279 deletions
@@ -25,8 +25,8 @@ public class BumperTemplate
public string AccentColor { get; private set; } = DefaultAccentColor;
public string TextColor { get; private set; } = DefaultTextColor;
/// <summary>Расширение загруженной фон-картинки (с точкой) или null тогда фон градиент/постер.</summary>
public string? BackgroundImageExtension { get; private set; }
/// <summary>Фон-картинка блока — ссылка на запись реестра изображений или null (тогда фон градиент/постер).</summary>
public Guid? BackgroundImageId { get; private set; }
/// <summary>Расширение загруженного звука (с точкой) или null — тогда синтезируется джингл.</summary>
public string? AudioExtension { get; private set; }
@@ -59,7 +59,7 @@ public class BumperTemplate
BackgroundColor2 = DefaultBackgroundColor2,
AccentColor = DefaultAccentColor,
TextColor = DefaultTextColor,
BackgroundImageExtension = null,
BackgroundImageId = null,
AudioExtension = null,
AudioDurationSeconds = null,
Revision = 0,
@@ -99,18 +99,18 @@ public class BumperTemplate
Revision++;
}
/// <summary>Отметить загруженную фон-картинку (extension — с точкой, нижний регистр). Меняет ревизию.</summary>
public void SetBackgroundImage(string extension)
/// <summary>Привязать фон-картинку блока (ссылка на реестр изображений). Меняет ревизию.</summary>
public void SetBackgroundImage(Guid imageId)
{
BackgroundImageExtension = extension;
BackgroundImageId = imageId;
Revision++;
}
public void ClearBackgroundImage()
{
if (BackgroundImageExtension is null)
if (BackgroundImageId is null)
return;
BackgroundImageExtension = null;
BackgroundImageId = null;
Revision++;
}
}
@@ -18,8 +18,8 @@ public class ShowEpisode
public string? Title { get; private set; }
public string? Overview { get; private set; }
/// <summary>Относительный путь локального кадра или null.</summary>
public string? StillPath { get; private set; }
/// <summary>Кадр серии — ссылка на запись общего реестра изображений или null.</summary>
public Guid? StillImageId { get; private set; }
public DateOnly? AirDate { get; private set; }
public DateTimeOffset CreatedAt { get; private set; }
@@ -43,13 +43,13 @@ public class ShowEpisode
Episode = episode;
}
/// <summary>Применить метаданные серии (кадр — уже скачанный локально — может быть null).</summary>
public void ApplyMetadata(string? title, string? overview, string? stillPath, DateOnly? airDate)
/// <summary>Применить метаданные серии (кадр — уже зарегистрирован в реестре — может быть null).</summary>
public void ApplyMetadata(string? title, string? overview, Guid? stillImageId, DateOnly? airDate)
{
Title = title;
Overview = overview;
if (stillPath is not null)
StillPath = stillPath;
if (stillImageId is not null)
StillImageId = stillImageId;
AirDate = airDate;
}
@@ -57,7 +57,7 @@ public class ShowEpisode
{
Title = null;
Overview = null;
StillPath = null;
StillImageId = null;
AirDate = null;
}
}