diff --git a/components/watch/ListOfEpisodes.tsx b/components/watch/ListOfEpisodes.tsx index 14bb5e3..2defbb3 100644 --- a/components/watch/ListOfEpisodes.tsx +++ b/components/watch/ListOfEpisodes.tsx @@ -27,13 +27,11 @@ export function ListOfEpisodes({ animeEpisodes, currentEpisode, handleCurrentEpisode, - handleTitle, handleVideoSkeletonVisibilty, }: { animeEpisodes: HiAnime.ScrapedAnimeEpisodes; currentEpisode: string; handleCurrentEpisode: (episode: string) => void; - handleTitle: (title: string) => void; handleVideoSkeletonVisibilty: (isVisible: boolean) => void; }) { const totlaEpisodes = animeEpisodes.totalEpisodes; @@ -80,7 +78,6 @@ export function ListOfEpisodes({ }`} onClick={() => { handleCurrentEpisode(episode.episodeId as string); - handleTitle(episode.title as string); handleVideoSkeletonVisibilty(true); }} > diff --git a/components/watch/VideoContainer.tsx b/components/watch/VideoContainer.tsx index 6624faf..b40f11b 100644 --- a/components/watch/VideoContainer.tsx +++ b/components/watch/VideoContainer.tsx @@ -24,14 +24,12 @@ type ServerInfoType = { export function VideoContainer({ currentEpisode, - title, isVideoSkeletonVisible, handleVideoSkeletonVisibilty, animeEpisodes, handleCurrentEpisode, }: { currentEpisode: string; - title: string; isVideoSkeletonVisible: boolean; handleVideoSkeletonVisibilty: (isVisible: boolean) => void; animeEpisodes: HiAnime.ScrapedAnimeEpisodes; @@ -51,6 +49,10 @@ export function VideoContainer({ const { settings, setSettings } = useSettings(); const { autoPlay, autoNext, autoSkip } = settings; + const title = animeEpisodes.episodes.find( + (episode) => episode.episodeId === currentEpisode, + )?.title; + const toggleAutoPlay = () => setSettings({ ...settings, autoPlay: !autoPlay }); const toggleAutoNext = () => @@ -313,7 +315,7 @@ export function VideoContainer({ ) : serverResources && !isVideoSkeletonVisible ? (