From a2fefa880be2e0832d534e245428dc048d5e2856 Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Mon, 5 May 2025 10:13:27 -0600 Subject: [PATCH] dont filter wyzie --- src/utils/wyziesubs.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/utils/wyziesubs.ts b/src/utils/wyziesubs.ts index 66c5385..5f79995 100644 --- a/src/utils/wyziesubs.ts +++ b/src/utils/wyziesubs.ts @@ -3,31 +3,31 @@ import { type SubtitleData, searchSubtitles } from 'wyzie-lib'; import { Caption } from '@/providers/captions'; -function isSubdlUrl(url: string) { - return url.endsWith('.subdl'); -} +// function isSubdlUrl(url: string) { +// return url.endsWith('.subdl'); +// } -export function filterSubtitles(list: Caption[]) { - const selected: Record = {}; +// export function filterSubtitles(list: Caption[]) { +// const selected: Record = {}; - for (const sub of list) { - const existing = selected[sub.language]; +// for (const sub of list) { +// const existing = selected[sub.language]; - if (!existing) { - selected[sub.language] = sub; - continue; - } +// if (!existing) { +// selected[sub.language] = sub; +// continue; +// } - const existingIsSubdl = isSubdlUrl(existing.url); - const currentIsSubdl = isSubdlUrl(sub.url); +// const existingIsSubdl = isSubdlUrl(existing.url); +// const currentIsSubdl = isSubdlUrl(sub.url); - if (existingIsSubdl && !currentIsSubdl) { - selected[sub.language] = sub; - } - } +// if (existingIsSubdl && !currentIsSubdl) { +// selected[sub.language] = sub; +// } +// } - return Object.values(selected); -} +// return Object.values(selected); +// } export async function addWyzieCaptions( captions: Caption[], @@ -65,7 +65,7 @@ export async function addWyzieCaptions( language: subtitle.language, })); - return [...captions, ...filterSubtitles(wyzieCaptions)]; + return [...captions, ...wyzieCaptions]; } catch (error) { console.error('Error fetching Wyzie subtitles:', error); return captions;