diff options
Diffstat (limited to 'src/lib/Media/Manga')
| -rw-r--r-- | src/lib/Media/Manga/chapters.ts | 17 |
1 files changed, 12 insertions, 5 deletions
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']; |