Add missing seasons endpoint and update metadata handling
Implemented a new endpoint to retrieve missing seasons for shows, enhancing the MetadataEndpoints class. Updated the IMetadataProvider interface to include a method for fetching season numbers. Adjusted the ShowSummaryDto to include other genres and modified the ListShowsQueryHandler to handle multiple genres. Enhanced the Omdb and Tmdb metadata providers to support season number retrieval. Updated frontend components to integrate missing seasons functionality, including API calls and UI elements for displaying missing seasons reports.
This commit is contained in:
@@ -4,6 +4,7 @@ using TeleWave.Application.Metadata;
|
||||
using TeleWave.Application.Metadata.ApplyShowMetadata;
|
||||
using TeleWave.Application.Metadata.ClearShowMetadata;
|
||||
using TeleWave.Application.Metadata.FindMissingEpisodes;
|
||||
using TeleWave.Application.Metadata.FindMissingSeasons;
|
||||
using TeleWave.Application.Metadata.GetProviders;
|
||||
using TeleWave.Application.Metadata.RefreshEpisodes;
|
||||
using TeleWave.Application.Metadata.SearchShows;
|
||||
@@ -34,6 +35,9 @@ public static class MetadataEndpoints
|
||||
admin
|
||||
.MapGet("/shows/{showId:guid}/missing-episodes", FindMissing)
|
||||
.Produces<MissingEpisodesReport>();
|
||||
admin
|
||||
.MapGet("/shows/{showId:guid}/missing-seasons", FindMissingSeasons)
|
||||
.Produces<MissingSeasonsReport>();
|
||||
|
||||
// Постеры шоу и кадры серий теперь в общем реестре и отдаются по /api/images/{id}.
|
||||
return app;
|
||||
@@ -137,6 +141,16 @@ public static class MetadataEndpoints
|
||||
var result = await sender.Send(new FindMissingEpisodesQuery(showId), cancellationToken);
|
||||
return result.ToHttpResult();
|
||||
}
|
||||
|
||||
private static async Task<IResult> FindMissingSeasons(
|
||||
Guid showId,
|
||||
ISender sender,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
var result = await sender.Send(new FindMissingSeasonsQuery(showId), cancellationToken);
|
||||
return result.ToHttpResult();
|
||||
}
|
||||
}
|
||||
|
||||
public sealed record ApplyMetadataBody(string Provider, string ExternalId);
|
||||
|
||||
Reference in New Issue
Block a user