Refactor various components to improve code clarity and maintainability. Update ListUsersQueryHandler to utilize UserListFilter for parameter handling. Refactor BumperSpecFactory and related classes to encapsulate input parameters into dedicated records, enhancing readability. Adjust MediaAsset and Slot classes to streamline content updates with new content models. Improve BumperRenderBackgroundService and MediaProcessingBackgroundService to use MediaReadyInfo for asset readiness, ensuring consistent parameter management across the application.
This commit is contained in:
@@ -34,6 +34,16 @@ type Candidate = { asset: MediaAssetDto; parsed: ParsedEpisode }
|
||||
|
||||
const PAGE_SIZE = 20
|
||||
|
||||
/** Пока идёт пакетное добавление — прогресс вместо подписи; серии добавляются по одной. */
|
||||
function addButtonLabel(
|
||||
progress: { current: number; total: number } | null,
|
||||
count: number,
|
||||
t: ReturnType<typeof useTranslation>['t'],
|
||||
) {
|
||||
if (progress) return `${progress.current}/${progress.total}`
|
||||
return `${t('admin.shows.addSelected')} (${count})`
|
||||
}
|
||||
|
||||
export function ShowDetail({ showId }: { showId: string }) {
|
||||
const { t } = useTranslation()
|
||||
const queryClient = useQueryClient()
|
||||
@@ -231,9 +241,7 @@ export function ShowDetail({ showId }: { showId: string }) {
|
||||
{t('admin.shows.deselectAll')}
|
||||
</Button>
|
||||
<Button size="sm" disabled={selected.length === 0 || adding != null} onClick={() => void bulkAdd()}>
|
||||
{adding
|
||||
? `${adding.current}/${adding.total}`
|
||||
: `${t('admin.shows.addSelected')} (${isSingle ? Math.min(1, selected.length) : selected.length})`}
|
||||
{addButtonLabel(adding, isSingle ? Math.min(1, selected.length) : selected.length, t)}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -347,20 +347,7 @@ export function ShowMetadataCard({ show, onChanged }: { show: ShowDto; onChanged
|
||||
})}
|
||||
</span>
|
||||
</div>
|
||||
{s.expected == null ? (
|
||||
<p className="mt-1 text-xs text-amber-500">
|
||||
{t('admin.metadata.missingUnknown')}
|
||||
</p>
|
||||
) : s.missing.length === 0 ? (
|
||||
<p className="mt-1 text-xs text-emerald-500">
|
||||
{t('admin.metadata.missingNone')}
|
||||
</p>
|
||||
) : (
|
||||
<p className="mt-1 text-muted-foreground">
|
||||
{t('admin.metadata.missingList')}:{' '}
|
||||
<span className="text-foreground">{s.missing.join(', ')}</span>
|
||||
</p>
|
||||
)}
|
||||
<SeasonGapNote gap={s} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -370,3 +357,21 @@ export function ShowMetadataCard({ show, onChanged }: { show: ShowDto; onChanged
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
/** Итог по сезону: чего не хватает — или что полный состав сезона неизвестен. */
|
||||
function SeasonGapNote({ gap }: { gap: MissingEpisodesReport['seasons'][number] }) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
if (gap.expected == null)
|
||||
return <p className="mt-1 text-xs text-amber-500">{t('admin.metadata.missingUnknown')}</p>
|
||||
|
||||
if (gap.missing.length === 0)
|
||||
return <p className="mt-1 text-xs text-emerald-500">{t('admin.metadata.missingNone')}</p>
|
||||
|
||||
return (
|
||||
<p className="mt-1 text-muted-foreground">
|
||||
{t('admin.metadata.missingList')}:{' '}
|
||||
<span className="text-foreground">{gap.missing.join(', ')}</span>
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user