diff --git a/frontend/src/features/admin/shows/ShowDetail.tsx b/frontend/src/features/admin/shows/ShowDetail.tsx index 61efa94..b38ee15 100644 --- a/frontend/src/features/admin/shows/ShowDetail.tsx +++ b/frontend/src/features/admin/shows/ShowDetail.tsx @@ -73,15 +73,15 @@ export function ShowDetail({ showId }: { showId: string }) { const selected = candidates.filter((c) => !deselected.has(c.asset.id)) - // Сколько разных сезонов загружено — по распознанным SxxExx в именах серий. - const seasonCount = useMemo(() => { - if (!show) return 0 - const seasons = new Set() + // Какие сезоны загружены — по распознанным SxxExx в именах серий (отсортированы по возрастанию). + const seasons = useMemo(() => { + if (!show) return [] as number[] + const set = new Set() for (const e of show.episodes) { const se = parseEpisode(e.assetName ?? '') - if (se) seasons.add(se.season) + if (se) set.add(se.season) } - return seasons.size + return [...set].sort((a, b) => a - b) }, [show]) if (isLoading || !show) return

{t('common.loading')}

@@ -126,17 +126,24 @@ export function ShowDetail({ showId }: { showId: string }) { -
-

{show.name}

- {t(`admin.shows.kinds.${show.kind}`)} - {show.kind === 'Series' && ( +
+
+

{show.name}

+ {t(`admin.shows.kinds.${show.kind}`)} + {show.kind === 'Series' && ( + + {t('admin.shows.seasons')}: {seasons.length} + + )} - {t('admin.shows.seasons')}: {seasonCount} + {t('admin.shows.episodes')}: {show.episodes.length} +
+ {show.kind === 'Series' && seasons.length > 0 && ( +

+ {t('admin.shows.loadedSeasons')}: {seasons.join(', ')} +

)} - - {t('admin.shows.episodes')}: {show.episodes.length} -
{canAdd && ( diff --git a/frontend/src/shared/lib/i18n.ts b/frontend/src/shared/lib/i18n.ts index a1b6381..200fac1 100644 --- a/frontend/src/shared/lib/i18n.ts +++ b/frontend/src/shared/lib/i18n.ts @@ -130,6 +130,7 @@ const resources = { kind: 'Тип', kinds: { Series: 'Сериал', Single: 'Полнометражка' }, seasons: 'Сезоны', + loadedSeasons: 'Загружены сезоны', episodes: 'Серии', episode: 'Серия', addEpisode: 'Добавить серию', @@ -358,6 +359,7 @@ const resources = { kind: 'Kind', kinds: { Series: 'Series', Single: 'Movie' }, seasons: 'Seasons', + loadedSeasons: 'Loaded seasons', episodes: 'Episodes', episode: 'Episode', addEpisode: 'Add episode',