From c144181881f60b04429f94da399b911afe0e1621 Mon Sep 17 00:00:00 2001 From: ner Date: Thu, 6 Aug 2026 22:20:26 +0300 Subject: [PATCH] feat(torrents): hide YTS provider for series YTS is a movies-only API, so drop its tab and skip its request when viewing a TV series; the tab grid adapts to the remaining providers. Co-Authored-By: Claude Fable 5 --- components/Preview/components/Torrents/index.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/Preview/components/Torrents/index.tsx b/components/Preview/components/Torrents/index.tsx index cb8588d..7f2d322 100644 --- a/components/Preview/components/Torrents/index.tsx +++ b/components/Preview/components/Torrents/index.tsx @@ -50,8 +50,11 @@ const showTorrentsModal = create(({ onResolve, ...show }: Props) => { const year = new Date(show.release).getFullYear(); + // YTS is a movies-only API, so it has nothing to offer for series + const isSeries = show.type === 'tv'; + const yts = useTorrents({ - query: show.title, + query: isSeries ? '' : show.title, queryFn: providers.yts.queryFn, sort, key: providers.yts.key, @@ -76,7 +79,9 @@ const showTorrentsModal = create(({ onResolve, ...show }: Props) => { const { order, ...dndProps } = useProvidersOrder(); - const tabs = order.map((key) => ({ query: queries[key], provider: providers[key] })); + const visibleOrder = isSeries ? order.filter((key) => key !== 'yts') : order; + + const tabs = visibleOrder.map((key) => ({ query: queries[key], provider: providers[key] })); const handleSearch = (event: FormEvent) => { event.preventDefault(); @@ -108,8 +113,8 @@ const showTorrentsModal = create(({ onResolve, ...show }: Props) => { - - + + {tabs.map(({ provider, query }) => ( ))}