From 9bc7dd8b3627e022d37c55cd959ebed124874efb Mon Sep 17 00:00:00 2001 From: Jorrin Date: Wed, 14 Aug 2024 00:37:10 +0200 Subject: [PATCH] lint --- apps/expo/src/components/player/CaptionsSelector.tsx | 5 +---- apps/expo/src/components/player/VideoPlayer.tsx | 12 ++++++------ apps/expo/src/hooks/player/useSourceScrape.ts | 6 +++--- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/apps/expo/src/components/player/CaptionsSelector.tsx b/apps/expo/src/components/player/CaptionsSelector.tsx index e82ac89..6694576 100644 --- a/apps/expo/src/components/player/CaptionsSelector.tsx +++ b/apps/expo/src/components/player/CaptionsSelector.tsx @@ -1,5 +1,4 @@ import type { LanguageCode } from "iso-639-1"; -import type { ContentCaption } from "subsrt-ts/dist/types/handler"; import { useState } from "react"; import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"; import { useMutation } from "@tanstack/react-query"; @@ -28,9 +27,7 @@ const parseCaption = async ( const data = await response.text(); return { ...caption, - data: parse(data).filter( - (cue) => cue.type === "caption", - ) as ContentCaption[], + data: parse(data).filter((cue) => cue.type === "caption"), }; }; diff --git a/apps/expo/src/components/player/VideoPlayer.tsx b/apps/expo/src/components/player/VideoPlayer.tsx index 8a582c3..5b21fcd 100644 --- a/apps/expo/src/components/player/VideoPlayer.tsx +++ b/apps/expo/src/components/player/VideoPlayer.tsx @@ -74,6 +74,12 @@ export const VideoPlayer = () => { const setMeta = usePlayerStore((state) => state.setMeta); const isLocalFile = usePlayerStore((state) => state.isLocalFile); + const { gestureControls, autoPlay } = usePlayerSettingsStore(); + const { updateWatchHistory, removeFromWatchHistory, getWatchHistoryItem } = + useWatchHistoryStore(); + const { wifiDefaultQuality, mobileDataDefaultQuality } = + useNetworkSettingsStore(); + const player = useVideoPlayer(videoSrc, (player) => { if (state === "playing") { player.play(); @@ -95,12 +101,6 @@ export const VideoPlayer = () => { } }, [player, setVideoPlayer]); - const { gestureControls, autoPlay } = usePlayerSettingsStore(); - const { updateWatchHistory, removeFromWatchHistory, getWatchHistoryItem } = - useWatchHistoryStore(); - const { wifiDefaultQuality, mobileDataDefaultQuality } = - useNetworkSettingsStore(); - const updateResizeMode = (newMode: ResizeMode) => { setResizeMode(newMode); void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); diff --git a/apps/expo/src/hooks/player/useSourceScrape.ts b/apps/expo/src/hooks/player/useSourceScrape.ts index 6935068..954f78a 100644 --- a/apps/expo/src/hooks/player/useSourceScrape.ts +++ b/apps/expo/src/hooks/player/useSourceScrape.ts @@ -66,9 +66,9 @@ export const useBaseScrape = () => { const startEvent = useCallback((id: ScraperEvent<"start">) => { const lastIdTmp = lastId.current; setSources((s) => { - if (s[id]) s[id]!.status = "pending"; - if (lastIdTmp && s[lastIdTmp] && s[lastIdTmp]!.status === "pending") - s[lastIdTmp]!.status = "success"; + if (s[id]) s[id].status = "pending"; + if (lastIdTmp && s[lastIdTmp] && s[lastIdTmp].status === "pending") + s[lastIdTmp].status = "success"; return { ...s }; }); setCurrentSource(id);