diff --git a/src/components/layout/AppHeader.tsx b/src/components/layout/AppHeader.tsx index d1aaa04..d92fefc 100644 --- a/src/components/layout/AppHeader.tsx +++ b/src/components/layout/AppHeader.tsx @@ -88,7 +88,7 @@ export default function AppHeader({ pinned, onTogglePin }: Props) { recursive: true, includeItemTypes: ['Movie'], fields: ['DateCreated', 'PrimaryImageAspectRatio', 'ImageTags'], - } as any), + }), getItemsApi(api!).getItems({ userId: auth.userId, sortBy: ['DateCreated'], @@ -97,10 +97,10 @@ export default function AppHeader({ pinned, onTogglePin }: Props) { recursive: true, includeItemTypes: ['Episode'], fields: ['DateCreated', 'PrimaryImageAspectRatio', 'ImageTags', 'SeriesName', 'SeriesId', 'SeriesPrimaryImageTag', 'ParentIndexNumber', 'IndexNumber'], - } as any), + }), ]) - const movies = (movieRes.data.Items || []) as any[] - const episodes = (episodeRes.data.Items || []) as any[] + const movies = movieRes.data.Items || [] + const episodes = episodeRes.data.Items || [] // Deduplicate episodes by series -- keep only the newest per show const seenSeries = new Set() const dedupedEpisodes: any[] = [] diff --git a/src/components/layout/Titlebar.tsx b/src/components/layout/Titlebar.tsx index 58dac0d..692fce0 100644 --- a/src/components/layout/Titlebar.tsx +++ b/src/components/layout/Titlebar.tsx @@ -41,7 +41,7 @@ export default function Titlebar() {
{items.map(it => { - const tmdbPoster = (it as any)._tmdbPoster as string | undefined - const inLibrary = (it as any)._inLibrary === true + const tmdbPoster = it._tmdbPoster + const inLibrary = it._inLibrary === true const poster = tmdbPoster || (it.ImageTags?.Primary && it.Id diff --git a/src/components/player/EpisodesPanel.tsx b/src/components/player/EpisodesPanel.tsx index d9d4012..81421f5 100644 --- a/src/components/player/EpisodesPanel.tsx +++ b/src/components/player/EpisodesPanel.tsx @@ -141,7 +141,7 @@ export default function EpisodesPanel({ {/* Panel */} } initial={{ x: '100%' }} animate={{ x: 0 }} exit={{ x: '100%' }} diff --git a/src/components/player/LibAssRenderer.tsx b/src/components/player/LibAssRenderer.tsx index 243512c..d64f6c5 100644 --- a/src/components/player/LibAssRenderer.tsx +++ b/src/components/player/LibAssRenderer.tsx @@ -38,7 +38,7 @@ export default function LibAssRenderer({ playerRef, subtitleUrl }: Props) { function getVideo(): HTMLVideoElement | null { const player = playerRef.current - const el = (player as any)?.el as HTMLElement | undefined + const el = (player as { el?: HTMLElement } | null)?.el return (el?.querySelector('video') as HTMLVideoElement | null) || null } @@ -50,8 +50,8 @@ export default function LibAssRenderer({ playerRef, subtitleUrl }: Props) { // SubtitlesOctopus is exposed as a global by the dist bundle. We // dynamic-import the npm package so the wasm worker isn't pulled // into the main bundle for users who never see ASS subs. - const mod: any = await import('libass-wasm') - const SubtitlesOctopus = mod.default || mod.SubtitlesOctopus || (window as any).SubtitlesOctopus + const mod = await import('libass-wasm') as { default?: unknown; SubtitlesOctopus?: unknown } + const SubtitlesOctopus = (mod.default || mod.SubtitlesOctopus || window.SubtitlesOctopus) as new (opts: Record) => { dispose(): void } if (!SubtitlesOctopus || cancelled) return if (octopusRef.current) { try { octopusRef.current.dispose() } catch { /* noop */ } diff --git a/src/components/player/StreamInfo.tsx b/src/components/player/StreamInfo.tsx index 429bde8..f5c974a 100644 --- a/src/components/player/StreamInfo.tsx +++ b/src/components/player/StreamInfo.tsx @@ -49,7 +49,7 @@ function readLiveStats(): LiveStats { } } } catch { /* timeranges throws sometimes */ } - const q = (video as any).getVideoPlaybackQuality?.() + const q = video.getVideoPlaybackQuality?.() return { bufferAheadSec: bufferAhead, droppedFrames: q?.droppedVideoFrames ?? null, @@ -59,7 +59,7 @@ function readLiveStats(): LiveStats { } async function checkHwDecode(stream: { Codec?: string | null; Width?: number | null; Height?: number | null; BitRate?: number | null } | null): Promise { - if (!stream || typeof (navigator as any).mediaCapabilities?.decodingInfo !== 'function') { + if (!stream || typeof navigator.mediaCapabilities?.decodingInfo !== 'function') { return { supported: null, hwAccelerated: null } } const codec = (stream.Codec || '').toLowerCase() @@ -75,7 +75,7 @@ async function checkHwDecode(stream: { Codec?: string | null; Width?: number | n : null if (!mimeCodec) return { supported: null, hwAccelerated: null } try { - const info = await (navigator as any).mediaCapabilities.decodingInfo({ + const info = await navigator.mediaCapabilities!.decodingInfo({ type: 'media-source', video: { contentType: `video/mp4; codecs="${mimeCodec}"`, @@ -163,7 +163,7 @@ export default function StreamInfo({ item, visible, playMethod }: Props) { useEffect(() => { if (!visible) return const v = getVideoStream(item || {}) - checkHwDecode(v as any).then(setHw) + checkHwDecode(v).then(setHw) }, [visible, item?.Id]) if (!visible || !item) return null