diff options
| author | real-zephex <[email protected]> | 2024-05-29 15:16:24 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-29 15:16:24 +0530 |
| commit | 0c10f208cbc82f99d7bb316a8680a8e9fbb6cb1e (patch) | |
| tree | 8a86f6199836b03e3a0296e754a2ce4bab998026 /src/app/manga/cacher.js | |
| parent | Update README.md (diff) | |
| parent | reverted back from next js 15 and react compiler due to some compatibility is... (diff) | |
| download | dramalama-0c10f208cbc82f99d7bb316a8680a8e9fbb6cb1e.tar.xz dramalama-0c10f208cbc82f99d7bb316a8680a8e9fbb6cb1e.zip | |
Merge pull request #42 from real-zephex/series-overhaul
⚡️ perf(deps): upgrade to react 19 and next js 15, add loading screen, drop manga support
Diffstat (limited to 'src/app/manga/cacher.js')
| -rw-r--r-- | src/app/manga/cacher.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/app/manga/cacher.js b/src/app/manga/cacher.js deleted file mode 100644 index 6059674..0000000 --- a/src/app/manga/cacher.js +++ /dev/null @@ -1,32 +0,0 @@ -// This function pre-fetches all the chapter pages links for a manga in the background
-"use server";
-
-export async function PreFetchChaterLinks(data) {
- try {
- const fetchPromises = data.map(async (element) => {
- const link = `https://consumet-jade.vercel.app/meta/anilist-manga/read?chapterId=${element.id}&provider=mangadex`;
- await fetch(link, { cache: "force-cache" });
- });
-
- await Promise.all(fetchPromises);
- console.log("Chapter links pre-fetched successfully!");
- } catch (error) {
- console.error(
- "Error occurred while pre-fetching chapter links:",
- error
- );
- }
-}
-
-export async function PreFetchMangaInfo(data) {
- try {
- const fetchPromises = data.results.map(async (element) => {
- const link = `https://consumet-jade.vercel.app/meta/anilist-manga/${element.id}?provider=mangadex`;
- await fetch(link, { next: { revalidate: 86400 } });
- });
- await Promise.all(fetchPromises);
- console.log("Manga info pre-fetched successfully!");
- } catch (error) {
- console.error("error", error);
- }
-}
|