Implement collection suggestions and bulk show addition features
ci / build-backend (push) Successful in 2m41s
ci / build-frontend (push) Successful in 44s
ci / tests (push) Successful in 2m33s
ci / sonar (push) Successful in 5m12s

Added new API endpoints for suggesting collections based on existing shows and for bulk adding shows to collections. Enhanced the backend with necessary logic and DTOs to support these features. Updated the frontend to include new components for displaying collection suggestions and managing bulk additions, improving the user experience for collection management. Localization updates were made to support these new features in both English and Russian.
This commit is contained in:
Leonid Pershin
2026-07-27 05:39:23 +03:00
parent 1a7f73a5bd
commit 5ad28b2966
39 changed files with 2710 additions and 10 deletions
@@ -0,0 +1,9 @@
namespace TeleWave.Domain.Library;
/// <summary>
/// Франшиза шоу по данным источника: «Гарри Поттер», «Терминатор». В домене это не сущность, а
/// подсказка от источника — по ней в библиотеке предлагается собрать <see cref="Collection"/>,
/// которую дальше правит человек. Само объединение остаётся его решением: у TMDb во франшизу
/// попадают и спин-оффы, которые в эфир одним произведением не идут.
/// </summary>
public sealed record MetadataFranchise(string ExternalId, string Name);
+15 -1
View File
@@ -135,16 +135,30 @@ public class Show
public bool CanAddEpisode => Kind == ShowKind.Series || _episodes.Count == 0;
/// <summary>Применить метаданные из внешнего источника. Постер (уже зарегистрирован в реестре) может быть null.</summary>
/// <summary>Франшиза шоу по данным источника: её идентификатор и название.</summary>
public string? FranchiseExternalId { get; private set; }
public string? FranchiseName { get; private set; }
public void ApplyMetadata(
string provider,
string externalId,
string? description,
int? year,
Guid? posterImageId
Guid? posterImageId,
MetadataFranchise? franchise = null
)
{
MetadataProvider = provider;
MetadataExternalId = externalId;
// Франшизу запоминаем, а не забываем сразу после применения: по ней потом предлагаются
// коллекции, и перезапрашивать источник ради каждого фильма было бы расточительно.
// Отсутствие в ответе — не повод стирать известное: у OMDb этих данных нет вовсе.
if (franchise is not null)
{
FranchiseExternalId = franchise.ExternalId;
FranchiseName = franchise.Name;
}
if (!string.IsNullOrWhiteSpace(description))
Description = description;
Year = year;