fix remaining build errors
This commit is contained in:
@@ -28,7 +28,10 @@ export default function PersonPage() {
|
||||
const filmography = useMemo(() => {
|
||||
const cast = (person?.combined_credits?.cast || []).map(c => ({ ...c, _kind: 'cast' as const }))
|
||||
const crew = (person?.combined_credits?.crew || []).map(c => ({ ...c, _kind: 'crew' as const }))
|
||||
let merged: ((TmdbCombinedCreditCast | TmdbCombinedCreditCrew) & { _kind: 'cast' | 'crew' })[] = [
|
||||
type MergedCredit =
|
||||
| (TmdbCombinedCreditCast & { _kind: 'cast' })
|
||||
| (TmdbCombinedCreditCrew & { _kind: 'crew' })
|
||||
let merged: MergedCredit[] = [
|
||||
...cast,
|
||||
...crew,
|
||||
]
|
||||
@@ -37,7 +40,7 @@ export default function PersonPage() {
|
||||
if (filter === 'Acting') {
|
||||
merged = merged.filter(c => c._kind === 'cast')
|
||||
} else {
|
||||
merged = merged.filter(c => c._kind === 'crew' && c.department === filter)
|
||||
merged = merged.filter((c): c is MergedCredit & { _kind: 'crew' } => c._kind === 'crew' && c.department === filter)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,7 +263,7 @@ export default function PersonPage() {
|
||||
{title}
|
||||
</p>
|
||||
<p className="text-[11px] text-text-3 truncate leading-tight mt-0.5">
|
||||
{c.character ? c.character : c.job}
|
||||
{c.character ? c.character : (c as TmdbCombinedCreditCrew).job}
|
||||
{year && (
|
||||
<>
|
||||
<span className="text-text-5 mx-1">·</span>
|
||||
|
||||
@@ -345,7 +345,7 @@ export default function PlayerPage() {
|
||||
const fromQueue = searchParams.get('resume') === 'true'
|
||||
if (showResumePromptPref && !fromQueue && pos > threshold) {
|
||||
setResumePromptOpen(true)
|
||||
resumePromptShownRef.current = item.Id
|
||||
resumePromptShownRef.current = item.Id ?? null
|
||||
}
|
||||
}, [item?.Id, searchParams, showResumePromptPref])
|
||||
|
||||
@@ -986,7 +986,8 @@ export default function PlayerPage() {
|
||||
if (resolvedSource?.SupportsDirectPlay) {
|
||||
const el = (playerRef.current as { el?: HTMLElement } | null)?.el
|
||||
const video = el?.querySelector('video') as HTMLVideoElement | null
|
||||
const native = video.audioTracks as { length: number; [i: number]: { enabled: boolean } } | undefined
|
||||
if (!video) return
|
||||
const native = video.audioTracks as { length: number; [i: number]: { enabled: boolean; language?: string } } | undefined
|
||||
if (native && native.length > 1) {
|
||||
const target = audioTracks.find(t => t.Index === jfIndex)
|
||||
const targetLang = (target?.Language || '').toLowerCase()
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useTmdbDetailEnrichment } from '../hooks/use-tmdb-detail'
|
||||
import { useLibraryByTmdbId } from '../hooks/use-jellyfin'
|
||||
import { useFanartMovie, useFanartTv } from '../hooks/use-external'
|
||||
import { getTmdbImageUrl, pickTmdbLogo } from '../api/tmdb'
|
||||
import type { TmdbMovie, TmdbTvShow } from '../api/tmdb'
|
||||
import { pickBestFanartImage } from '../api/fanart'
|
||||
import { mapTmdbToJf } from '../lib/tmdb-mapping'
|
||||
import ContentRow from '../components/ui/ContentRow'
|
||||
@@ -262,7 +263,7 @@ export default function TmdbDetailPage({ tmdbId, kind }: Props) {
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
{kind === 'tv' && data.number_of_seasons > 0 && (
|
||||
{kind === 'tv' && (data.number_of_seasons ?? 0) > 0 && (
|
||||
<>
|
||||
<Dot />
|
||||
<span className="inline-flex items-center gap-1 tabular-nums">
|
||||
@@ -287,7 +288,7 @@ export default function TmdbDetailPage({ tmdbId, kind }: Props) {
|
||||
)}
|
||||
|
||||
<div className="flex items-center gap-2.5 flex-wrap">
|
||||
<RequestButton tmdbId={tmdbId} kind={kind} tmdbData={data} />
|
||||
<RequestButton tmdbId={tmdbId} kind={kind} tmdbData={data as TmdbMovie | TmdbTvShow | null} />
|
||||
{matchedLocal && (
|
||||
<button
|
||||
onClick={() => navigate(`/item/${matchedLocal.id}`)}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
} from '../../hooks/use-tmdb'
|
||||
import { useLibraryByTmdbId } from '../../hooks/use-jellyfin'
|
||||
import { mapTmdbToJf } from '../../lib/tmdb-mapping'
|
||||
import type { TmdbDiscoverItem } from '../../api/tmdb'
|
||||
import { tmdbMovieGenreId, tmdbTvGenreId } from '../../lib/tmdb-genres'
|
||||
import ContentRow from '../../components/ui/ContentRow'
|
||||
import { usePreferencesStore } from '../../stores/preferences-store'
|
||||
@@ -253,7 +254,7 @@ export function GenreRow({ genre }: { genre: { label: string; subtitle: string }
|
||||
const items = useMemo(() => {
|
||||
const m = (movies.data?.results || []).map(x => ({ ...x, media_type: 'movie' }))
|
||||
const t = (tv.data?.results || []).map(x => ({ ...x, media_type: 'tv' }))
|
||||
const out: { id: number; media_type: string }[] = []
|
||||
const out: TmdbDiscoverItem[] = []
|
||||
const max = Math.max(m.length, t.length)
|
||||
for (let i = 0; i < max && out.length < 20; i++) {
|
||||
if (m[i]) out.push(m[i])
|
||||
|
||||
@@ -37,7 +37,7 @@ export function ServerDashboardSection() {
|
||||
const transcodes = activeSessions.filter(s => s.PlayState?.PlayMethod === 'Transcode')
|
||||
|
||||
const uptime = useMemo(() => {
|
||||
const start = info?.ServerStartTime
|
||||
const start = (info as { ServerStartTime?: string } | null | undefined)?.ServerStartTime
|
||||
if (!start) return null
|
||||
const ms = Date.now() - new Date(start).getTime()
|
||||
const days = Math.floor(ms / 86_400_000)
|
||||
|
||||
Reference in New Issue
Block a user