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:
@@ -26,11 +26,12 @@ export function DeleteShowDialog({
|
||||
}: Readonly<{
|
||||
show: ShowSummaryDto
|
||||
pending: boolean
|
||||
onConfirm: (withMedia: boolean) => void
|
||||
onConfirm: (options: { withMedia: boolean; withSchedule: boolean }) => void
|
||||
onClose: () => void
|
||||
}>) {
|
||||
const { t } = useTranslation()
|
||||
const [withMedia, setWithMedia] = useState(false)
|
||||
const [withSchedule, setWithSchedule] = useState(false)
|
||||
const hasMedia = show.episodeCount > 0
|
||||
|
||||
return (
|
||||
@@ -41,6 +42,24 @@ export function DeleteShowDialog({
|
||||
<DialogDescription>{t('admin.shows.deleteHint', { name: show.name })}</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
{/* Занятость эфиром — самая частая причина отказа, и лечится она не всегда пересборкой:
|
||||
идущую запись она не трогает, а выключенный канал вещать и не начнёт. Поэтому здесь
|
||||
не только объяснение, но и способ довести удаление до конца. */}
|
||||
<label className="flex items-start gap-2 text-sm">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="mt-1"
|
||||
checked={withSchedule}
|
||||
onChange={(e) => setWithSchedule(e.target.checked)}
|
||||
/>
|
||||
<span>
|
||||
{t('admin.shows.deleteWithSchedule')}
|
||||
<span className="block text-xs text-muted-foreground">
|
||||
{t('admin.shows.deleteWithScheduleHint')}
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
{hasMedia && (
|
||||
<label className="flex items-start gap-2 text-sm">
|
||||
<input
|
||||
@@ -66,7 +85,7 @@ export function DeleteShowDialog({
|
||||
size="sm"
|
||||
variant="destructive"
|
||||
disabled={pending}
|
||||
onClick={() => onConfirm(withMedia)}
|
||||
onClick={() => onConfirm({ withMedia, withSchedule })}
|
||||
>
|
||||
{t('common.delete')}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user