1 parent
b555ef3b94
commit
080279e456
22 files changed
+400
-67
No files matched your search
@@ -2,7 +2,8 @@ import { locale, t } from '../i18n'
|
||||
import { Check, ChevronLeft, ChevronRight, Loader2, Plus, RefreshCw, X } from 'lucide-react'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { loadAiring, refreshAiring, saveAiring } from '../lib/airing'
|
||||
import { getAniListById, getTmdbDetails, releaseToResult, type GlobalRelease, type ReleaseCategory } from '../lib/catalogApi'
|
||||
import { findTmdbSeries, getAniListById, getTmdbDetails, releaseToResult, type GlobalRelease, type ReleaseCategory } from '../lib/catalogApi'
|
||||
import { findFranchiseItem } from '../lib/franchise'
|
||||
import { cachedMonth, isBrowsableMonth, loadMonth, RELEASE_CATEGORIES } from '../lib/globalReleases'
|
||||
import { remotePosterToLocal } from '../lib/image'
|
||||
import { calendarEvents, loadReleases, refreshReleases } from '../lib/releases'
|
||||
@@ -198,7 +199,12 @@ export default function CalendarView({ onClose, onOpen }: { onClose: () => void;
|
||||
}
|
||||
for (const r of global) {
|
||||
const key = `${r.externalId}|${r.date}`
|
||||
const item = byExt.get(r.externalId) ?? byTitle.get(normalizeText(r.title)) ?? (r.originalTitle ? byTitle.get(normalizeText(r.originalTitle)) : undefined)
|
||||
const item =
|
||||
byExt.get(r.externalId) ??
|
||||
byTitle.get(normalizeText(r.title)) ??
|
||||
(r.originalTitle ? byTitle.get(normalizeText(r.originalTitle)) : undefined) ??
|
||||
// « Black Clover Season 2 » sur AniList = ma fiche « Black Clover »
|
||||
(r.cat !== 'film' ? findFranchiseItem(items, [r.title, r.originalTitle], { type: r.cat }) : undefined)
|
||||
map.set(key, {
|
||||
key,
|
||||
date: r.date,
|
||||
@@ -262,7 +268,12 @@ export default function CalendarView({ onClose, onOpen }: { onClose: () => void;
|
||||
try {
|
||||
let data: Partial<MediaInput> = {}
|
||||
let poster: string | undefined
|
||||
if (r.externalId.startsWith('anilist:')) {
|
||||
// Anime : on préfère la fiche TMDB, qui regroupe toutes les saisons (sinon chaque saison AniList ferait une fiche)
|
||||
const series = r.externalId.startsWith('anilist:') && hasKey ? await findTmdbSeries([r.title, r.originalTitle], settings.tmdbKey!).catch(() => undefined) : undefined
|
||||
if (series) {
|
||||
data = await getTmdbDetails(series, settings.tmdbKey!)
|
||||
poster = series.posterUrl ? await remotePosterToLocal(series.posterUrl) : undefined
|
||||
} else if (r.externalId.startsWith('anilist:')) {
|
||||
const res = await getAniListById(r.externalId)
|
||||
data = { ...res?.prefill }
|
||||
poster = res?.posterUrl ?? r.poster
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { t } from '../i18n'
|
||||
import { Check, Loader2, Search } from 'lucide-react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { getTmdbDetails, searchAniList, searchTmdb, type SearchResult, type Source } from '../lib/catalogApi'
|
||||
import { getTmdbDetails, searchAll, type SearchResult } from '../lib/catalogApi'
|
||||
import { findFranchiseItem } from '../lib/franchise'
|
||||
import { remotePosterToLocal } from '../lib/image'
|
||||
import { cx } from '../lib/utils'
|
||||
import { useMedia } from '../store'
|
||||
import type { MediaInput } from '../types'
|
||||
import type { MediaInput, MediaItem } from '../types'
|
||||
|
||||
interface Props {
|
||||
/** Reçoit les métadonnées trouvées (titre, type, genres, épisodes, affiche…). */
|
||||
@@ -14,18 +15,14 @@ interface Props {
|
||||
/** Identifiant externe de la fiche en cours d'édition (pour ne pas la signaler comme doublon). */
|
||||
currentExternalId?: string
|
||||
onGoToSettings?: () => void
|
||||
/** Nouvelle fiche : si le titre (ou une autre saison) est déjà dans la bibliothèque, on ouvre la fiche existante. */
|
||||
onOpenExisting?: (item: MediaItem) => void
|
||||
}
|
||||
|
||||
const SOURCES: { value: Source; readonly label: string; hint: string }[] = [
|
||||
{ value: 'tmdb', get label() { return t('search.moviesSeries') }, hint: 'TMDB' },
|
||||
{ value: 'anilist', get label() { return t('typePlural.anime') }, hint: 'AniList' },
|
||||
]
|
||||
|
||||
/** Recherche un titre dans TMDB ou AniList et remplit la fiche automatiquement. */
|
||||
export default function DatabaseSearch({ onPick, initialQuery = '', currentExternalId, onGoToSettings }: Props) {
|
||||
/** Recherche un titre (films, séries et animes en une seule fois) et remplit la fiche automatiquement. */
|
||||
export default function DatabaseSearch({ onPick, initialQuery = '', currentExternalId, onGoToSettings, onOpenExisting }: Props) {
|
||||
const { items, settings } = useMedia()
|
||||
const hasKey = !!settings.tmdbKey?.trim()
|
||||
const [source, setSource] = useState<Source>(hasKey ? 'tmdb' : 'anilist')
|
||||
const [query, setQuery] = useState(initialQuery)
|
||||
const [results, setResults] = useState<SearchResult[]>([])
|
||||
const [loading, setLoading] = useState(false)
|
||||
@@ -33,13 +30,17 @@ export default function DatabaseSearch({ onPick, initialQuery = '', currentExter
|
||||
const [error, setError] = useState<string>()
|
||||
const requestId = useRef(0)
|
||||
|
||||
const existing = new Set(items.map((i) => i.externalId).filter((id) => id && id !== currentExternalId))
|
||||
const others = items.filter((i) => !currentExternalId || i.externalId !== currentExternalId)
|
||||
/** Déjà dans ma bibliothèque : même référence, ou une autre saison de la même série. */
|
||||
const inLibrary = (r: SearchResult) =>
|
||||
others.find((i) => i.externalId === r.externalId) ??
|
||||
findFranchiseItem(others, [r.title, r.originalTitle, ...(r.altTitles ?? [])], { type: r.typeGuess })
|
||||
|
||||
// Recherche avec un petit délai pendant la frappe
|
||||
useEffect(() => {
|
||||
const q = query.trim()
|
||||
setError(undefined)
|
||||
if (q.length < 2 || (source === 'tmdb' && !hasKey)) {
|
||||
if (q.length < 2) {
|
||||
setResults([])
|
||||
setLoading(false)
|
||||
return
|
||||
@@ -48,7 +49,7 @@ export default function DatabaseSearch({ onPick, initialQuery = '', currentExter
|
||||
setLoading(true)
|
||||
const timer = setTimeout(async () => {
|
||||
try {
|
||||
const res = source === 'tmdb' ? await searchTmdb(q, settings.tmdbKey!) : await searchAniList(q)
|
||||
const res = await searchAll(q, hasKey ? settings.tmdbKey : undefined)
|
||||
if (id === requestId.current) setResults(res)
|
||||
} catch (e) {
|
||||
if (id === requestId.current) {
|
||||
@@ -60,9 +61,11 @@ export default function DatabaseSearch({ onPick, initialQuery = '', currentExter
|
||||
}
|
||||
}, 450)
|
||||
return () => clearTimeout(timer)
|
||||
}, [query, source, hasKey, settings.tmdbKey])
|
||||
}, [query, hasKey, settings.tmdbKey])
|
||||
|
||||
const pick = async (r: SearchResult) => {
|
||||
const mine = onOpenExisting && inLibrary(r)
|
||||
if (mine) return onOpenExisting(mine)
|
||||
setPicking(r.externalId)
|
||||
setError(undefined)
|
||||
try {
|
||||
@@ -83,43 +86,32 @@ export default function DatabaseSearch({ onPick, initialQuery = '', currentExter
|
||||
<div className="card p-4">
|
||||
<div className="mb-3 flex items-center justify-between gap-2">
|
||||
<span className="eyebrow">{t('search.fillFrom')}</span>
|
||||
<div className="flex rounded-full border border-line p-0.5">
|
||||
{SOURCES.map((s) => (
|
||||
<button
|
||||
key={s.value}
|
||||
type="button"
|
||||
onClick={() => setSource(s.value)}
|
||||
className={cx('rounded-full px-3 py-1 text-xs font-medium transition-colors', source === s.value ? 'bg-ink text-bg' : 'text-ink-3')}
|
||||
>
|
||||
{s.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<span className="text-[11px] text-ink-3">{t('search.allKinds')}</span>
|
||||
</div>
|
||||
|
||||
{source === 'tmdb' && !hasKey ? (
|
||||
<div className="rounded-xl border border-dashed border-line-strong p-3.5 text-sm text-ink-2">
|
||||
{t('search.needKey')}
|
||||
<div className="relative">
|
||||
<Search size={17} className="pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-ink-3" />
|
||||
<input
|
||||
type="search"
|
||||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder="Parasite, Frieren, Crash Landing on You…"
|
||||
className="field pl-10"
|
||||
enterKeyHint="search"
|
||||
autoComplete="off"
|
||||
/>
|
||||
{loading && <Loader2 size={17} className="absolute right-3.5 top-1/2 -translate-y-1/2 animate-spin text-ink-3" />}
|
||||
</div>
|
||||
|
||||
{!hasKey && (
|
||||
<div className="mt-2 text-xs text-ink-3">
|
||||
{t('search.animeOnly')}
|
||||
{onGoToSettings && (
|
||||
<button type="button" onClick={onGoToSettings} className="mt-2 block font-medium text-ink">
|
||||
<button type="button" onClick={onGoToSettings} className="ml-1 font-medium text-ink">
|
||||
{t('search.openSettings')} <span className="text-accent">→</span>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div className="relative">
|
||||
<Search size={17} className="pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-ink-3" />
|
||||
<input
|
||||
type="search"
|
||||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder={source === 'tmdb' ? 'Parasite, Crash Landing on You…' : 'Frieren, One Piece…'}
|
||||
className="field pl-10"
|
||||
enterKeyHint="search"
|
||||
autoComplete="off"
|
||||
/>
|
||||
{loading && <Loader2 size={17} className="absolute right-3.5 top-1/2 -translate-y-1/2 animate-spin text-ink-3" />}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{error && <p className="mt-2 text-sm text-accent">{error}</p>}
|
||||
@@ -127,7 +119,8 @@ export default function DatabaseSearch({ onPick, initialQuery = '', currentExter
|
||||
{results.length > 0 && (
|
||||
<ul className="-mx-1 mt-3 max-h-[22rem] divide-y divide-line overflow-y-auto overscroll-contain">
|
||||
{results.map((r) => {
|
||||
const already = existing.has(r.externalId)
|
||||
const mine = inLibrary(r)
|
||||
const already = !!mine
|
||||
return (
|
||||
<li key={r.externalId}>
|
||||
<button
|
||||
@@ -148,7 +141,7 @@ export default function DatabaseSearch({ onPick, initialQuery = '', currentExter
|
||||
{r.originalTitle && <span className="block truncate text-xs text-ink-3">{r.originalTitle}</span>}
|
||||
<span className="mt-1 block text-[10.5px] uppercase text-ink-3">
|
||||
{[r.kindLabel, r.year].filter(Boolean).join(' · ')}
|
||||
{already && <span className="text-accent"> · {t('search.already')}</span>}
|
||||
{already && <span className="text-accent"> · {mine.externalId === r.externalId ? t('search.already') : t('search.alreadySeries')}</span>}
|
||||
</span>
|
||||
</span>
|
||||
{picking === r.externalId ? (
|
||||
@@ -163,13 +156,13 @@ export default function DatabaseSearch({ onPick, initialQuery = '', currentExter
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{!loading && !error && query.trim().length >= 2 && results.length === 0 && !(source === 'tmdb' && !hasKey) && (
|
||||
{!loading && !error && query.trim().length >= 2 && results.length === 0 && (
|
||||
<p className="mt-3 text-sm text-ink-3">{t('search.noResults')}</p>
|
||||
)}
|
||||
|
||||
<p className="mt-3 flex items-start gap-1.5 text-[11px] leading-relaxed text-ink-3">
|
||||
<Check size={12} className="mt-0.5 shrink-0" />
|
||||
{t('search.privacy', { source: source === 'tmdb' ? 'TMDB' : 'AniList' })}
|
||||
{t('search.privacy', { source: hasKey ? 'TMDB / AniList' : 'AniList' })}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { t } from '../i18n'
|
||||
import { Heart, Plus } from 'lucide-react'
|
||||
import { TYPE_BY_VALUE } from '../lib/constants'
|
||||
import { seasonPosition } from '../lib/franchise'
|
||||
import { useMedia } from '../store'
|
||||
import type { MediaItem } from '../types'
|
||||
import { StatusPill, TypeBadge } from './Badges'
|
||||
@@ -9,16 +10,21 @@ import { RatingBadge } from './Rating'
|
||||
|
||||
function Progress({ item }: { item: MediaItem }) {
|
||||
if (!TYPE_BY_VALUE[item.type].episodic || (!item.episodesWatched && !item.episodesTotal)) return null
|
||||
const pct = item.episodesTotal ? Math.min(100, (item.episodesWatched / item.episodesTotal) * 100) : 0
|
||||
// Série en plusieurs saisons : progression dans la saison en cours
|
||||
const pos = seasonPosition(item)
|
||||
const done = pos ? pos.episode : item.episodesWatched
|
||||
const size = pos ? pos.size : item.episodesTotal
|
||||
const pct = size ? Math.min(100, (done / size) * 100) : 0
|
||||
const season = pos?.season ?? item.season
|
||||
return (
|
||||
<div className="mt-1.5">
|
||||
<div className="flex justify-between text-[10.5px] text-ink-3">
|
||||
<span>
|
||||
{item.season ? `S${item.season} · ` : ''}{t('card.ep', { n: item.episodesWatched })}
|
||||
{item.episodesTotal ? `/${item.episodesTotal}` : ''}
|
||||
{season ? `S${season} · ` : ''}{t('card.ep', { n: done })}
|
||||
{size ? `/${size}` : ''}
|
||||
</span>
|
||||
</div>
|
||||
{item.episodesTotal ? (
|
||||
{size ? (
|
||||
<div className="mt-1.5 h-[3px] overflow-hidden rounded-full bg-line">
|
||||
<div className="h-full rounded-full bg-accent" style={{ width: `${pct}%` }} />
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,8 @@ import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
||||
import { CRITERIA, DEFAULT_FILM_MINUTES, MEDIA_TYPES, platformSuggestions as defaultPlatforms, STATUSES, TYPE_BY_VALUE } from '../lib/constants'
|
||||
import { canonicalGenre, canonicalSubtype, genreLabel, genreSuggestions as defaultGenres, subtypeLabel, subtypeSuggestions } from '../lib/genres'
|
||||
import { fileToPosterDataURL } from '../lib/image'
|
||||
import { getTmdbCredits } from '../lib/catalogApi'
|
||||
import { getTmdbCredits, getTmdbSeasons } from '../lib/catalogApi'
|
||||
import { episodesBeforeSeason, seasonPosition } from '../lib/franchise'
|
||||
import { renderItemCard, slug } from '../lib/shareCard'
|
||||
import { useScrollLock } from '../lib/scrollLock'
|
||||
import { cx, formatRating, todayISO } from '../lib/utils'
|
||||
@@ -38,6 +39,7 @@ const METADATA_KEYS = [
|
||||
'overview',
|
||||
'duration',
|
||||
'episodesTotal',
|
||||
'seasons',
|
||||
'episodeDuration',
|
||||
'poster',
|
||||
'externalId',
|
||||
@@ -70,6 +72,39 @@ interface Props {
|
||||
item?: MediaItem
|
||||
onClose: () => void
|
||||
onGoToSettings?: () => void
|
||||
/** Ouvre une autre fiche (titre déjà dans la bibliothèque) */
|
||||
onOpenItem?: (item: MediaItem) => void
|
||||
}
|
||||
|
||||
/** Choix de la saison : « S2 » = la saison 1 est vue, on commence la 2. */
|
||||
function SeasonPicker({ seasons, watched, season, onChange }: { seasons: number[]; watched: number; season?: number; onChange: (episodesWatched: number, season: number) => void }) {
|
||||
const current = seasonPosition({ episodesWatched: watched, seasons, season })!
|
||||
return (
|
||||
<div>
|
||||
<span className="label">{t('form.season')}</span>
|
||||
<div className="no-scrollbar -mx-1 flex gap-1.5 overflow-x-auto px-1 pb-1">
|
||||
{seasons.map((size, k) => {
|
||||
const n = k + 1
|
||||
const start = episodesBeforeSeason(seasons, n)
|
||||
const done = watched >= start + size
|
||||
const on = n === current.season
|
||||
return (
|
||||
<button
|
||||
key={n}
|
||||
type="button"
|
||||
onClick={() => !on && (n < current.season ? onChange(start + size, n) : onChange(start, n))}
|
||||
className={cx('chip shrink-0', on && 'chip-on')}
|
||||
aria-pressed={on}
|
||||
title={t('form.seasonEpisodes', { count: size })}
|
||||
>
|
||||
{done && !on && <Check size={13} />}
|
||||
S{n}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** « Moi vs le public » : ma note comparée à la moyenne TMDB / AniList. */
|
||||
@@ -127,7 +162,7 @@ function Rewatches({ dates, onChange }: { dates: string[]; onChange: (d: string[
|
||||
)
|
||||
}
|
||||
|
||||
export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
||||
export default function MediaForm({ item, onClose, onGoToSettings, onOpenItem }: Props) {
|
||||
const { add, update, remove, items, settings, lists } = useMedia()
|
||||
const [form, setForm] = useState<MediaInput>(() => {
|
||||
if (!item) return EMPTY
|
||||
@@ -142,10 +177,29 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
||||
const fileRef = useRef<HTMLInputElement>(null)
|
||||
const [showInfo, setShowInfo] = useState(false)
|
||||
const typeInfo = TYPE_BY_VALUE[form.type]
|
||||
const pos = typeInfo.episodic ? seasonPosition(form) : undefined
|
||||
|
||||
// Bloque le défilement de la page derrière la feuille
|
||||
useScrollLock()
|
||||
|
||||
// Série TMDB ajoutée avant le suivi par saison : on récupère le découpage en arrière-plan
|
||||
const extId = form.externalId
|
||||
useEffect(() => {
|
||||
const key = settings.tmdbKey?.trim()
|
||||
if (!extId?.startsWith('tmdb:tv:') || form.seasons || !key || !navigator.onLine) return
|
||||
let alive = true
|
||||
getTmdbSeasons(extId, key)
|
||||
.then(({ seasons, total }) => {
|
||||
if (!alive || !seasons) return
|
||||
setForm((f) => (f.externalId === extId && !f.seasons ? { ...f, seasons, episodesTotal: Math.max(f.episodesTotal ?? 0, total ?? 0) || f.episodesTotal } : f))
|
||||
})
|
||||
.catch(() => {})
|
||||
return () => {
|
||||
alive = false
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [extId])
|
||||
|
||||
const set = <K extends keyof MediaInput>(key: K, value: MediaInput[K]) => setForm((f) => ({ ...f, [key]: value }))
|
||||
|
||||
// Suggestions = listes par défaut + ce que j'ai déjà utilisé
|
||||
@@ -162,6 +216,8 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
||||
for (const key of METADATA_KEYS) {
|
||||
if (data[key] !== undefined) (next as unknown as Record<string, unknown>)[key] = data[key]
|
||||
}
|
||||
// Découpage par saison : celui de la nouvelle source (ou aucun)
|
||||
next.seasons = data.seasons
|
||||
if (data.type && data.type !== 'autre') next.subtype = undefined
|
||||
if (data.genres?.length) next.genres = [...new Set([...f.genres, ...data.genres])]
|
||||
if (data.platform && !f.platform) next.platform = data.platform
|
||||
@@ -218,6 +274,8 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
||||
poster: form.poster?.trim() || undefined,
|
||||
overview: form.overview?.trim() || undefined,
|
||||
}
|
||||
const pos = seasonPosition(clean)
|
||||
if (pos) clean.season = pos.season
|
||||
try {
|
||||
if (item) await update(item.id, clean)
|
||||
else await add(clean)
|
||||
@@ -285,6 +343,7 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
||||
initialQuery={item ? form.title : ''}
|
||||
currentExternalId={item?.externalId}
|
||||
onGoToSettings={onGoToSettings}
|
||||
onOpenExisting={!item && onOpenItem ? onOpenItem : undefined}
|
||||
/>
|
||||
) : (
|
||||
<button
|
||||
@@ -410,21 +469,34 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
||||
{typeInfo.episodic ? (
|
||||
<Section title={t('form.episodes')}>
|
||||
<div className="card space-y-5 p-4">
|
||||
{pos && form.seasons ? (
|
||||
<SeasonPicker seasons={form.seasons} watched={form.episodesWatched} season={form.season} onChange={(n, season) => setForm((f) => ({ ...f, episodesWatched: n, season }))} />
|
||||
) : null}
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm text-ink-2">{t('home.episodesSeen')}</span>
|
||||
<span className="text-sm text-ink-2">{pos ? t('form.episodesOfSeason', { season: pos.season }) : t('home.episodesSeen')}</span>
|
||||
<div className="flex items-center gap-3">
|
||||
<button type="button" onClick={() => changeEpisodes(-1)} className="grid size-10 place-items-center rounded-full border border-line-strong text-ink-2" aria-label={t('form.minusEp')}>
|
||||
<Minus size={17} />
|
||||
</button>
|
||||
<span className="min-w-16 text-center text-2xl font-bold tabular-nums">
|
||||
{form.episodesWatched}
|
||||
{form.episodesTotal ? <span className="text-base text-ink-3">/{form.episodesTotal}</span> : null}
|
||||
{pos ? pos.episode : form.episodesWatched}
|
||||
{pos ? <span className="text-base text-ink-3">/{pos.size}</span> : form.episodesTotal ? <span className="text-base text-ink-3">/{form.episodesTotal}</span> : null}
|
||||
</span>
|
||||
<button type="button" onClick={() => changeEpisodes(1)} className="grid size-10 place-items-center rounded-full bg-accent-fill text-on-accent" aria-label={t('form.plusEp')}>
|
||||
<Plus size={17} strokeWidth={2.5} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{pos ? (
|
||||
<div className="flex items-end justify-between gap-3">
|
||||
<p className="pb-2 text-xs text-ink-3">{t('form.seasonsTotal', { seasons: form.seasons!.length, count: form.episodesTotal ?? 0 })}</p>
|
||||
<div className="w-28 shrink-0">
|
||||
<Field label={t('form.minPerEp')}>
|
||||
<input className="field" type="number" inputMode="numeric" min={0} value={form.episodeDuration ?? ''} onChange={(e) => set('episodeDuration', toNum(e.target.value))} placeholder={String(typeInfo.episodeMinutes)} />
|
||||
</Field>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="grid grid-cols-3 gap-3">
|
||||
<Field label={t('form.total')}>
|
||||
<input className="field" type="number" inputMode="numeric" min={0} value={form.episodesTotal ?? ''} onChange={(e) => set('episodesTotal', toNum(e.target.value))} placeholder="?" />
|
||||
@@ -436,6 +508,7 @@ export default function MediaForm({ item, onClose, onGoToSettings }: Props) {
|
||||
<input className="field" type="number" inputMode="numeric" min={0} value={form.episodeDuration ?? ''} onChange={(e) => set('episodeDuration', toNum(e.target.value))} placeholder={String(typeInfo.episodeMinutes)} />
|
||||
</Field>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Section>
|
||||
) : (
|
||||
|
||||
Reference in new issue
Block a user