aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/api/v2/episode/[id].js10
-rw-r--r--pages/en/anime/watch/[...info].js12
-rw-r--r--pages/id/index.js4
-rw-r--r--pages/index.js33
4 files changed, 25 insertions, 34 deletions
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}`}
</title>
- {/* 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 */}
+ <meta
+ name="title"
+ data-title-romaji={info?.title?.romaji}
+ data-title-english={info?.title?.english}
+ data-title-native={info?.title?.native}
+ />
<meta name="twitter:card" content="summary_large_image" />
- {/* Write the best SEO for this homepage */}
<meta
name="description"
content={episodeNavigation?.playing?.description || info?.description}
@@ -486,13 +490,13 @@ export default function Watch({
"Loading..."}
</Link>
</div>
- <p className="font-karla">
+ <h3 className="font-karla">
{episodeNavigation?.playing?.number ? (
`Episode ${episodeNavigation?.playing?.number}`
) : (
<Skeleton width={120} height={16} />
)}
- </p>
+ </h3>
</div>
<div>
<div className="flex gap-2 text-sm">
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() {
</Head>
<main className="flex flex-col h-screen">
<NewNavbar />
+ <MobileNav hideProfile />
{/* Create an under construction page with tailwind css */}
<div className="h-full w-screen flex-center flex-grow flex-col">
<Image
@@ -26,7 +28,7 @@ export default function Home() {
className="w-[26vw] md:w-[15vw]"
/>
<h1 className="text-2xl sm:text-4xl xl:text-6x font-bold my-4">
- 🚧 Work still on progress 🚧
+ 🚧 Page Under Construction 🚧
</h1>
<p className="text-base sm:text-lg xl:text-x text-gray-300 mb-6 text-center">
"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,
+ },
+ };
}