Add metadata management for shows: implement metadata retrieval, application, and updates in the API and UI. Enhance Show and ShowDto models to include metadata fields, and update the database schema accordingly. Introduce new endpoints for metadata operations and integrate metadata display in the ShowDetail component.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using TeleWave.Application.Metadata;
|
||||
|
||||
namespace TeleWave.Application.Common.Interfaces;
|
||||
|
||||
/// <summary>Источник метаданных о шоу/сериях (TMDb, OMDb). Реализация ходит во внешний API.</summary>
|
||||
public interface IMetadataProvider
|
||||
{
|
||||
/// <summary>Ключ источника: «tmdb», «omdb».</summary>
|
||||
string Key { get; }
|
||||
|
||||
Task<IReadOnlyList<MetadataCandidate>> SearchShowsAsync(
|
||||
string query,
|
||||
CancellationToken cancellationToken
|
||||
);
|
||||
|
||||
Task<ShowMetadata?> GetShowAsync(string externalId, CancellationToken cancellationToken);
|
||||
|
||||
Task<EpisodeMetadata?> GetEpisodeAsync(
|
||||
string externalId,
|
||||
int season,
|
||||
int episode,
|
||||
CancellationToken cancellationToken
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>Резолвит провайдер по ключу и перечисляет реально настроенные (с API-ключом) источники.</summary>
|
||||
public interface IMetadataProviderResolver
|
||||
{
|
||||
IMetadataProvider? Resolve(string key);
|
||||
|
||||
/// <summary>Ключи источников, у которых задан API-ключ (доступны в UI).</summary>
|
||||
IReadOnlyList<string> AvailableKeys { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user