fix remaining build errors
This commit is contained in:
@@ -277,7 +277,7 @@ export default function DetailHero({
|
||||
<RequestButton
|
||||
tmdbId={Number(tmdbId)}
|
||||
kind={item.Type === 'Movie' ? 'movie' : 'tv'}
|
||||
tmdbData={tmdbData}
|
||||
tmdbData={tmdbData || null}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
TmdbKeyword,
|
||||
TmdbReview,
|
||||
TmdbVideo,
|
||||
TmdbCastMember,
|
||||
} from '../../api/tmdb'
|
||||
import type { CinemetaMeta } from '../../api/cinemeta'
|
||||
import type { TvmazeShow } from '../../api/tvmaze'
|
||||
@@ -66,8 +67,8 @@ interface Props {
|
||||
wikiTitle: string | null
|
||||
region: string
|
||||
watchProviders: TmdbWatchProviders | null | undefined
|
||||
cast: unknown[]
|
||||
crew: unknown[]
|
||||
cast: TmdbCastMember[]
|
||||
crew: TmdbCastMember[]
|
||||
keywords: TmdbKeyword[]
|
||||
reviews: TmdbReview[]
|
||||
videos: TmdbVideo[] | undefined
|
||||
@@ -76,7 +77,7 @@ interface Props {
|
||||
libraryMap: Map<string, { id: string; name: string; type: string }> | undefined
|
||||
overview: string
|
||||
overviewSource: string | null
|
||||
sources: { Id?: string }[]
|
||||
sources: { Id?: string | null }[]
|
||||
activeSourceId: string | null
|
||||
onSourceChange: (id: string | null) => void
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function VersionsSelector({ item, selectedSourceId, onChange }: P
|
||||
<div className="flex gap-2 flex-wrap">
|
||||
{sources.map(src => {
|
||||
const summary = summarizeSource(src)
|
||||
const id = src.Id || src.id || ''
|
||||
const id = src.Id || ''
|
||||
const active = id === selectedSourceId
|
||||
return (
|
||||
<button
|
||||
|
||||
@@ -140,7 +140,7 @@ function DecadeRow({ decade, kind }: { decade: Decade; kind: 'movie' | 'tv' }) {
|
||||
const data = kind === 'movie' ? movieQuery.data : tvQuery.data
|
||||
|
||||
const items = useMemo(() => {
|
||||
const raw = (data?.results || []).map(m => ({ ...m, media_type: kind as const }))
|
||||
const raw = (data?.results || []).map(m => ({ ...m, media_type: kind }))
|
||||
return mapTmdbToJf(filterToMissing(raw, lib.data, hideAdult, m => !!m.adult), lib.data)
|
||||
}, [data, lib.data, hideAdult, kind])
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useMemo, useState, useEffect } from 'react'
|
||||
import { useMemo, useState, useEffect, useCallback } from 'react'
|
||||
import { motion, AnimatePresence } from 'framer-motion'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Shuffle, RotateCw, ArrowRight, Star, X } from '../../lib/icons'
|
||||
|
||||
@@ -41,6 +41,7 @@ export function SpotlightHero({ kind = 'all' }: { kind?: 'all' | 'movie' | 'tv'
|
||||
const mediaType: 'movie' | 'tv' = pick.media_type === 'tv' || pick.first_air_date ? 'tv' : 'movie'
|
||||
|
||||
function open() {
|
||||
if (!pick) return
|
||||
navigate(`/item/tmdb-${mediaType}-${pick.id}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useLibraryByTmdbId, useLibraryGenreDistribution } from '../../hooks/use
|
||||
import { usePreferencesStore } from '../../stores/preferences-store'
|
||||
import { filterToMissing } from '../../pages/discover/helpers'
|
||||
import { tmdbMovieGenreId, tmdbTvGenreId } from '../../lib/tmdb-genres'
|
||||
import type { TmdbDiscoverItem } from '../../api/tmdb'
|
||||
|
||||
const TMDB_IMG = 'https://image.tmdb.org/t/p'
|
||||
|
||||
@@ -66,7 +67,7 @@ export default function TonightHero({ kind }: Props) {
|
||||
|
||||
const pick = useMemo(() => {
|
||||
// Personalized pool wins when present + non-empty.
|
||||
const personalRaw = (personalData?.results || []).map(m => ({ ...m, media_type: kind as const }))
|
||||
const personalRaw = (personalData?.results || []).map(m => ({ ...m, media_type: kind }))
|
||||
const personalPool = filterToMissing(personalRaw, lib.data, hideAdult, m => !!m.adult)
|
||||
.filter(m => m.backdrop_path && m.overview)
|
||||
if (personalPool.length > 0) {
|
||||
@@ -84,7 +85,7 @@ export default function TonightHero({ kind }: Props) {
|
||||
|
||||
if (!pick) return null
|
||||
|
||||
const item = pick.item
|
||||
const item = pick.item as TmdbDiscoverItem
|
||||
const title: string = item.title || item.name || ''
|
||||
const overview: string = item.overview || ''
|
||||
const backdrop = `${TMDB_IMG}/w1280${item.backdrop_path}`
|
||||
|
||||
@@ -87,7 +87,7 @@ export default function AppHeader({ pinned, onTogglePin }: Props) {
|
||||
limit: 10,
|
||||
recursive: true,
|
||||
includeItemTypes: ['Movie'],
|
||||
fields: ['DateCreated', 'PrimaryImageAspectRatio', 'ImageTags'],
|
||||
fields: ['DateCreated', 'PrimaryImageAspectRatio', 'ImageTags'] as any[],
|
||||
}),
|
||||
getItemsApi(api!).getItems({
|
||||
userId: auth.userId,
|
||||
@@ -96,7 +96,7 @@ export default function AppHeader({ pinned, onTogglePin }: Props) {
|
||||
limit: 50,
|
||||
recursive: true,
|
||||
includeItemTypes: ['Episode'],
|
||||
fields: ['DateCreated', 'PrimaryImageAspectRatio', 'ImageTags', 'SeriesName', 'SeriesId', 'SeriesPrimaryImageTag', 'ParentIndexNumber', 'IndexNumber'],
|
||||
fields: ['DateCreated', 'PrimaryImageAspectRatio', 'ImageTags', 'SeriesName', 'SeriesId', 'SeriesPrimaryImageTag', 'ParentIndexNumber', 'IndexNumber'] as any[],
|
||||
}),
|
||||
])
|
||||
const movies = movieRes.data.Items || []
|
||||
|
||||
@@ -34,7 +34,7 @@ interface Props {
|
||||
volume: number
|
||||
loopA: number | null
|
||||
loopB: number | null
|
||||
chapters: { StartPositionTicks: number; Name?: string | null; ImageTag?: string | null }[]
|
||||
chapters: { StartPositionTicks?: number | null; Name?: string | null; ImageTag?: string | null }[]
|
||||
bookmarksRefreshKey: number
|
||||
previousItem: BaseItemDto | null | undefined
|
||||
nextItem: BaseItemDto | null | undefined
|
||||
|
||||
@@ -11,7 +11,7 @@ import SyncPlayPanel from './SyncPlayPanel'
|
||||
import type { BaseItemDto } from '../../api/types'
|
||||
|
||||
export interface ChapterMarker {
|
||||
StartPositionTicks: number
|
||||
StartPositionTicks?: number | null
|
||||
Name?: string | null
|
||||
ImageTag?: string | null
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ export default function RequestModal({ open, onClose, tmdbId, kind, tmdbData }:
|
||||
monitored,
|
||||
searchOnAdd,
|
||||
title: match.title,
|
||||
titleSlug: match.titleSlug || '',
|
||||
titleSlug: (match.title || '').toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, ''),
|
||||
year: match.year || 0,
|
||||
images: match.images,
|
||||
minimumAvailability: 'released',
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function PersonSpotlightRow({ personId, name, role, profilePath,
|
||||
? (credits.crew || []).filter(c => c.job === 'Director')
|
||||
: (credits.cast || [])
|
||||
// Drop trivia / archival appearances and ultra-deep cuts.
|
||||
.filter(c => COMMERCIAL_DEPARTMENTS.includes(c.department || 'Acting'))
|
||||
.filter(c => COMMERCIAL_DEPARTMENTS.includes((c as { department?: string }).department || 'Acting'))
|
||||
|
||||
// De-dupe by id (a director may have multiple crew credits on one film
|
||||
// when they're also writer; a cast member may appear twice for episodic
|
||||
|
||||
@@ -205,7 +205,7 @@ export default function QuickLookModal() {
|
||||
<RequestButton
|
||||
tmdbId={numericTmdb}
|
||||
kind={item.Type === 'Movie' ? 'movie' : 'tv'}
|
||||
tmdbData={tmdbData}
|
||||
tmdbData={(tmdbData || null) as (import('../../api/tmdb').TmdbMovie | import('../../api/tmdb').TmdbTvShow | null)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user