Implement image management enhancements: add functionality to relocate legacy images during startup, update image handling in show metadata, and refactor related API endpoints to utilize the new image storage system. Adjust database schema to support image references and update UI components for improved image selection and display.

This commit is contained in:
Leonid Pershin
2026-07-25 11:43:17 +03:00
parent 149cd153b9
commit a970eae7d2
30 changed files with 1231 additions and 172 deletions
@@ -0,0 +1,10 @@
namespace TeleWave.Application.Common.Interfaces;
/// <summary>Скачанное изображение: содержимое + расширение (с точкой, нижний регистр).</summary>
public sealed record DownloadedImage(byte[] Content, string Extension);
/// <summary>Скачивание изображения по URL (например постера/кадра из метаданных) для реестра.</summary>
public interface IImageDownloader
{
Task<DownloadedImage?> DownloadAsync(string url, CancellationToken cancellationToken);
}
@@ -6,23 +6,6 @@ namespace TeleWave.Application.Common.Interfaces;
/// </summary>
public interface IMetadataImageStore
{
/// <summary>Скачивает постер по URL и сохраняет для шоу. Возвращает относительный путь или null при ошибке.</summary>
Task<string?> DownloadShowPosterAsync(
Guid showId,
string url,
CancellationToken cancellationToken
);
/// <summary>Сохраняет загруженный вручную постер шоу. Возвращает относительный путь.</summary>
Task<string> SaveShowPosterAsync(
Guid showId,
string extension,
Stream content,
CancellationToken cancellationToken
);
void DeleteShowImages(Guid showId);
/// <summary>Скачивает кадр серии по URL. Возвращает относительный путь или null при ошибке.</summary>
Task<string?> DownloadEpisodeStillAsync(
Guid episodeId,