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:
@@ -61,9 +61,24 @@ public sealed class GridScheduleGenerator(
|
||||
c => c.Id == channelId,
|
||||
cancellationToken
|
||||
);
|
||||
if (channel is null || !channel.IsEnabled || channel.TemplateId is null)
|
||||
if (channel is null)
|
||||
return new GenerationReport(0, [], ChannelSkipped: true);
|
||||
|
||||
// Канал выключен или без сетки — вещать нечем. По таймеру это просто пропуск, но по кнопке
|
||||
// «Применить» админ ждёт, что лента придёт в соответствие с настройками: раз эфира нет,
|
||||
// не должно остаться и будущих записей. Иначе они висят вечно — пересобрать их нечем,
|
||||
// а удалить шоу, которое в них стоит, невозможно.
|
||||
if (!channel.IsEnabled || channel.TemplateId is null)
|
||||
{
|
||||
if (!rebuildFuture)
|
||||
return new GenerationReport(0, [], ChannelSkipped: true);
|
||||
|
||||
await dbContext
|
||||
.ScheduleEntries.Where(e => e.ChannelId == channelId && e.StartsAtUtc >= now)
|
||||
.ExecuteDeleteAsync(cancellationToken);
|
||||
return new GenerationReport(0, []);
|
||||
}
|
||||
|
||||
await using var transaction = await dbContext.BeginTransactionAsync(cancellationToken);
|
||||
await dbContext.AcquireChannelLockAsync(channelId, cancellationToken);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user