From 0a30e0570a5d22dd8c459fd9769fe4386c07aae8 Mon Sep 17 00:00:00 2001
From: Factiven
Date: Tue, 24 Oct 2023 11:05:06 +0700
Subject: Update v4.2.1
---
pages/api/v2/episode/[id].js | 10 +++++++---
pages/en/anime/watch/[...info].js | 12 ++++++++----
pages/id/index.js | 4 +++-
pages/index.js | 33 +++++++--------------------------
4 files changed, 25 insertions(+), 34 deletions(-)
(limited to 'pages')
diff --git a/pages/api/v2/episode/[id].js b/pages/api/v2/episode/[id].js
index b86a198..029d131 100644
--- a/pages/api/v2/episode/[id].js
+++ b/pages/api/v2/episode/[id].js
@@ -1,6 +1,5 @@
import axios from "axios";
import { rateLimitStrict, rateLimiterRedis, redis } from "@/lib/redis";
-import appendImagesToEpisodes from "@/utils/combineImages";
import appendMetaToEpisodes from "@/utils/appendMetaToEpisodes";
let CONSUMET_URI;
@@ -158,8 +157,13 @@ async function fetchCoverImage(id, available = false) {
export default async function handler(req, res) {
const { id, releasing = "false", dub = false, refresh = null } = req.query;
- // if releasing is true then cache for 10 minutes, if it false cache for 1 month;
- const cacheTime = releasing === "true" ? 60 * 10 : 60 * 60 * 24 * 30;
+ // if releasing is true then cache for 1 hour, if it false cache for 1 month;
+ let cacheTime = null;
+ if (releasing === "true") {
+ cacheTime = 60 * 60; // 1 hour
+ } else if (releasing === "false") {
+ cacheTime = 60 * 60 * 24 * 30; // 1 month
+ }
let cached;
let meta;
diff --git a/pages/en/anime/watch/[...info].js b/pages/en/anime/watch/[...info].js
index a838b7f..2427669 100644
--- a/pages/en/anime/watch/[...info].js
+++ b/pages/en/anime/watch/[...info].js
@@ -354,9 +354,13 @@ export default function Watch({
{episodeNavigation?.playing?.title ||
`${info?.title?.romaji} - Episode ${epiNumber}`}
- {/* Write the best SEO for this watch page with data of anime title from info.title.romaji, episode title from episodeNavigation?.playing?.title, description from episodeNavigation?.playing?.description, episode number from epiNumber */}
+
- {/* Write the best SEO for this homepage */}
-
+
{episodeNavigation?.playing?.number ? (
`Episode ${episodeNavigation?.playing?.number}`
) : (
)}
-
+
diff --git a/pages/id/index.js b/pages/id/index.js
index b8898e5..5ef870d 100644
--- a/pages/id/index.js
+++ b/pages/id/index.js
@@ -4,6 +4,7 @@ import Image from "next/image";
import Link from "next/link";
import Footer from "@/components/shared/footer";
import { NewNavbar } from "@/components/shared/NavBar";
+import MobileNav from "@/components/shared/MobileNav";
export default function Home() {
return (
@@ -16,6 +17,7 @@ export default function Home() {
+
{/* Create an under construction page with tailwind css */}
- 🚧 Work still on progress 🚧
+ 🚧 Page Under Construction 🚧
"Please be patient, as we're still working on this page and it will
diff --git a/pages/index.js b/pages/index.js
index 56b2c1f..25d5b20 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -1,5 +1,4 @@
import Head from "next/head";
-import { parseCookies } from "nookies";
export default function Home() {
return (
@@ -23,29 +22,11 @@ export default function Home() {
);
}
-export async function getServerSideProps(context) {
- const cookie = parseCookies(context);
-
- if (cookie.lang === "en") {
- return {
- redirect: {
- destination: "/en",
- permanent: false,
- },
- };
- } else if (cookie.lang === "id") {
- return {
- redirect: {
- destination: "/id",
- permanent: false,
- },
- };
- } else {
- return {
- redirect: {
- destination: "/en",
- permanent: false,
- },
- };
- }
+export async function getServerSideProps() {
+ return {
+ redirect: {
+ destination: "/en",
+ permanent: false,
+ },
+ };
}
--
cgit v1.2.3