diff options
Diffstat (limited to 'components/manga')
| -rw-r--r-- | components/manga/panels/firstPanel.js | 18 | ||||
| -rw-r--r-- | components/manga/panels/secondPanel.js | 26 | ||||
| -rw-r--r-- | components/manga/panels/thirdPanel.js | 16 | ||||
| -rw-r--r-- | components/manga/rightBar.js | 2 |
4 files changed, 33 insertions, 29 deletions
diff --git a/components/manga/panels/firstPanel.js b/components/manga/panels/firstPanel.js index 8470fd0..0ceb2fb 100644 --- a/components/manga/panels/firstPanel.js +++ b/components/manga/panels/firstPanel.js @@ -66,13 +66,13 @@ export default function FirstPanel({ if (session) { if (aniId?.length > 6) return; const currentChapter = chapter.chapters?.find( - (x) => x.id === currentId + (x) => x.id === currentId, ); if (currentChapter) { const chapterNumber = currentChapter.number ?? chapter.chapters.indexOf(currentChapter) + 1; - markProgress(aniId, chapterNumber); + markProgress({ mediaId: aniId, progress: chapterNumber }); console.log("marking progress"); } } @@ -142,14 +142,14 @@ export default function FirstPanel({ > <Image src={`https://aoi.moopa.live/utils/image-proxy?url=${encodeURIComponent( - i.url + i.url, )}${ i?.headers?.Referer ? `&headers=${encodeURIComponent( - JSON.stringify(i?.headers) + JSON.stringify(i?.headers), )}` : `&headers=${encodeURIComponent( - JSON.stringify(getHeaders(chapter.providerId)) + JSON.stringify(getHeaders(chapter.providerId)), )}` }`} alt={index} @@ -213,10 +213,10 @@ export default function FirstPanel({ `/en/manga/read/${ chapter.providerId }?id=${mangadexId}&chapterId=${encodeURIComponent( - prevChapter?.id + prevChapter?.id, )}${aniId?.length > 6 ? "" : `&anilist=${aniId}`}&num=${ prevChapter?.number - }` + }`, ) } > @@ -234,10 +234,10 @@ export default function FirstPanel({ `/en/manga/read/${ chapter.providerId }?id=${mangadexId}&chapterId=${encodeURIComponent( - nextChapter?.id + nextChapter?.id, )}${aniId?.length > 6 ? "" : `&anilist=${aniId}`}&num=${ nextChapter?.number - }` + }`, ) } > diff --git a/components/manga/panels/secondPanel.js b/components/manga/panels/secondPanel.js index 23a9da0..6ebc292 100644 --- a/components/manga/panels/secondPanel.js +++ b/components/manga/panels/secondPanel.js @@ -69,12 +69,12 @@ export default function SecondPanel({ if (index + 1 >= image.length - 4 && !hasRun.current) { const current = chapterData.chapters?.find( - (x) => x.id === currentChapter.id + (x) => x.id === currentChapter.id, ); const chapterNumber = chapterData.chapters.indexOf(current) + 1; if (chapterNumber) { - markProgress(aniId, chapterNumber); + markProgress({ mediaId: aniId, progress: chapterNumber }); } hasRun.current = true; } @@ -98,15 +98,15 @@ export default function SecondPanel({ if (index + 1 >= image.length - 4 && !hasRun.current) { console.log("marking progress"); const current = chapterData.chapters?.find( - (x) => x.id === currentChapter.id + (x) => x.id === currentChapter.id, ); const chapterNumber = chapterData.chapters.indexOf(current) + 1; if (chapterNumber) { - markProgress(aniId, chapterNumber); + markProgress({ mediaId: aniId, progress: chapterNumber }); } - markProgress(aniId, chapterNumber); + markProgress({ mediaId: aniId, progress: chapterNumber }); hasRun.current = true; } }; @@ -137,16 +137,16 @@ export default function SecondPanel({ height={500} className="w-1/2 h-screen object-contain" src={`https://aoi.moopa.live/utils/image-proxy?url=${encodeURIComponent( - image[image.length - index - 2]?.url + image[image.length - index - 2]?.url, )}${ image[image.length - index - 2]?.headers?.Referer ? `&headers=${encodeURIComponent( JSON.stringify( - image[image.length - index - 2]?.headers - ) + image[image.length - index - 2]?.headers, + ), )}` : `&headers=${encodeURIComponent( - JSON.stringify(getHeaders(providerId)) + JSON.stringify(getHeaders(providerId)), )}` }`} alt="Manga Page" @@ -158,14 +158,16 @@ export default function SecondPanel({ height={500} className="w-1/2 h-screen object-contain" src={`https://aoi.moopa.live/utils/image-proxy?url=${encodeURIComponent( - image[image.length - index - 1]?.url + image[image.length - index - 1]?.url, )}${ image[image.length - index - 1]?.headers?.Referer ? `&headers=${encodeURIComponent( - JSON.stringify(image[image.length - index - 1]?.headers) + JSON.stringify( + image[image.length - index - 1]?.headers, + ), )}` : `&headers=${encodeURIComponent( - JSON.stringify(getHeaders(providerId)) + JSON.stringify(getHeaders(providerId)), )}` }`} alt="Manga Page" diff --git a/components/manga/panels/thirdPanel.js b/components/manga/panels/thirdPanel.js index 77bb132..7c43f6e 100644 --- a/components/manga/panels/thirdPanel.js +++ b/components/manga/panels/thirdPanel.js @@ -66,12 +66,12 @@ export default function ThirdPanel({ } if (index + 1 >= image.length - 2 && !hasRun.current) { const current = chapterData.chapters?.find( - (x) => x.id === currentChapter.id + (x) => x.id === currentChapter.id, ); const chapterNumber = chapterData.chapters.indexOf(current) + 1; if (chapterNumber) { - markProgress(aniId, chapterNumber); + markProgress({ mediaId: aniId, progress: chapterNumber }); } hasRun.current = true; } @@ -94,12 +94,12 @@ export default function ThirdPanel({ } if (index + 1 >= image.length - 2 && !hasRun.current) { const current = chapterData.chapters?.find( - (x) => x.id === currentChapter.id + (x) => x.id === currentChapter.id, ); const chapterNumber = chapterData.chapters.indexOf(current) + 1; if (chapterNumber) { - markProgress(aniId, chapterNumber); + markProgress({ mediaId: aniId, progress: chapterNumber }); } hasRun.current = true; @@ -128,14 +128,16 @@ export default function ThirdPanel({ className="w-full h-screen object-contain" onClick={() => setMobileVisible(!mobileVisible)} src={`https://aoi.moopa.live/utils/image-proxy?url=${encodeURIComponent( - image[image.length - index - 1]?.url + image[image.length - index - 1]?.url, )}${ image[image.length - index - 1]?.headers?.Referer ? `&headers=${encodeURIComponent( - JSON.stringify(image[image.length - index - 1]?.headers) + JSON.stringify( + image[image.length - index - 1]?.headers, + ), )}` : `&headers=${encodeURIComponent( - JSON.stringify(getHeaders(providerId)) + JSON.stringify(getHeaders(providerId)), )}` }`} alt="Manga Page" diff --git a/components/manga/rightBar.js b/components/manga/rightBar.js index 9672fc4..3da04d9 100644 --- a/components/manga/rightBar.js +++ b/components/manga/rightBar.js @@ -43,7 +43,7 @@ export default function RightBar({ parsedProgress === parseInt(parsedProgress) && parsedVolumeProgress === parseInt(parsedVolumeProgress) ) { - markProgress(id, progress, status, volumeProgress); + markProgress({ mediaId: id, progress, stats: status, volumeProgress }); hasRun.current = true; } else { toast.error("Progress must be a whole number!"); |