Add bulk poster filling endpoint and enhance show deletion options
Introduced a new endpoint for bulk filling collection posters, allowing for automatic assignment of posters to collections without existing images. Updated the DeleteShowCommand to include an option for cutting shows from future airings, enhancing the deletion process. Refactored related components and API calls to support these features, ensuring a seamless user experience. Additionally, updated localization strings to reflect the new functionalities and adjusted tests to verify correct behavior.
This commit is contained in:
+7
-1
@@ -8,7 +8,8 @@ namespace TeleWave.Application.Library.Collections.Suggest;
|
||||
|
||||
public sealed class CreateCollectionFromSuggestionCommandHandler(
|
||||
IAppDbContext dbContext,
|
||||
CollectionSuggestionBuilder builder
|
||||
CollectionSuggestionBuilder builder,
|
||||
CollectionPosterPicker posters
|
||||
) : ICommandHandler<CreateCollectionFromSuggestionCommand, Result<Guid>>
|
||||
{
|
||||
public async Task<Result<Guid>> Handle(
|
||||
@@ -42,6 +43,11 @@ public sealed class CreateCollectionFromSuggestionCommandHandler(
|
||||
collection.AddShow(part.ShowId);
|
||||
|
||||
dbContext.Collections.Add(collection);
|
||||
|
||||
// Постер берём у первой части: франшиза узнаётся по обложке первого фильма, а коллекция
|
||||
// без картинки теряется в списке среди таких же безымянных прямоугольников.
|
||||
await posters.FillAsync([collection], cancellationToken);
|
||||
|
||||
return Result.Success(collection.Id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user