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:
@@ -45,7 +45,17 @@ public sealed class GetShowQueryHandler(IAppDbContext dbContext)
|
||||
.ToList();
|
||||
|
||||
return Result.Success(
|
||||
new ShowDto(show.Id, show.Name, show.Kind, show.Description, episodeDtos)
|
||||
new ShowDto(
|
||||
show.Id,
|
||||
show.Name,
|
||||
show.Kind,
|
||||
show.Description,
|
||||
show.MetadataProvider,
|
||||
show.MetadataExternalId,
|
||||
show.Year,
|
||||
show.PosterPath is not null,
|
||||
episodeDtos
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,16 @@ public sealed class ListShowsQueryHandler(IAppDbContext dbContext)
|
||||
.Where(season => season is not null)
|
||||
.Distinct()
|
||||
.Count();
|
||||
return new ShowSummaryDto(s.Id, s.Name, s.Kind, s.Episodes.Count, seasons, s.CreatedAt);
|
||||
return new ShowSummaryDto(
|
||||
s.Id,
|
||||
s.Name,
|
||||
s.Kind,
|
||||
s.Episodes.Count,
|
||||
seasons,
|
||||
s.Year,
|
||||
s.PosterPath is not null,
|
||||
s.CreatedAt
|
||||
);
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ public sealed record ShowSummaryDto(
|
||||
ShowKind Kind,
|
||||
int EpisodeCount,
|
||||
int SeasonCount,
|
||||
int? Year,
|
||||
bool HasPoster,
|
||||
DateTimeOffset CreatedAt
|
||||
);
|
||||
|
||||
@@ -26,5 +28,9 @@ public sealed record ShowDto(
|
||||
string Name,
|
||||
ShowKind Kind,
|
||||
string? Description,
|
||||
string? MetadataProvider,
|
||||
string? MetadataExternalId,
|
||||
int? Year,
|
||||
bool HasPoster,
|
||||
IReadOnlyList<EpisodeDto> Episodes
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user