From d59b5e92bc2de54d19413d4a21df6e761dac8c69 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 28 Dec 2023 17:25:24 -0800 Subject: chore(manga): no proxy dev --- src/lib/Media/Manga/chapters.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/lib/Media/Manga') diff --git a/src/lib/Media/Manga/chapters.ts b/src/lib/Media/Manga/chapters.ts index 8d072559..203d7210 100644 --- a/src/lib/Media/Manga/chapters.ts +++ b/src/lib/Media/Manga/chapters.ts @@ -1,4 +1,5 @@ import { recentMediaActivities, type Media } from '$lib/AniList/media'; +import proxy from '$lib/Utility/proxy'; import settings from '../../../stores/settings'; import type { UserIdentity } from '../../AniList/identity'; import { database } from '../../Database/chapters'; @@ -41,9 +42,11 @@ const getManga = async ( try { return await ( await fetch( - `https://due-proxy.fuwn.workers.dev/?q=https://api.mangadex.org/manga?title=${encodeURIComponent( - title - )}&year=${year}&status[]=${status}` + proxy( + `https://api.mangadex.org/manga?title=${encodeURIComponent( + title + )}&year=${year}&status[]=${status}` + ) ) ).json(); } catch { @@ -124,7 +127,9 @@ export const chapterCount = async ( const mangadexId = mangadexDataJson['data'][0]['id']; const lastChapterDataJson = await ( await fetch( - `https://due-proxy.fuwn.workers.dev/?q=https://api.mangadex.org/manga/${mangadexId}/feed?order[chapter]=desc&translatedLanguage[]=en&limit=1&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic` + proxy( + `https://api.mangadex.org/manga/${mangadexId}/feed?order[chapter]=desc&translatedLanguage[]=en&limit=1&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic` + ) ) ).json(); @@ -147,7 +152,9 @@ export const chapterCount = async ( if (!settings.get().calculateDisableOutOfDateVolumeWarning) { const volumeOfChapterData = await ( await fetch( - `https://due-proxy.fuwn.workers.dev/?q=https://api.mangadex.org/chapter?manga=${mangadexId}&chapter=${manga.mediaListEntry?.progress}&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic&limit=1` + proxy( + `https://api.mangadex.org/chapter?manga=${mangadexId}&chapter=${manga.mediaListEntry?.progress}&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic&limit=1` + ) ) ).json(); let lastAvailableVolume = lastChapterDataJson['data'][0]['attributes']['volume']; -- cgit v1.2.3