aboutsummaryrefslogtreecommitdiff
path: root/pages/en/anime
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-10-22 19:43:17 +0700
committerGitHub <[email protected]>2023-10-22 19:43:17 +0700
commitf801f8f422954b884a6541321dba0669ee9d6173 (patch)
treee0d5e106b99e9b4e0a4c4bf7bb0464617db85b8d /pages/en/anime
parentBump @babel/traverse from 7.22.8 to 7.23.2 (#90) (diff)
downloadmoopa-4.2.0.tar.xz
moopa-4.2.0.zip
Update v4.2.0 (#93)v4.2.0
Diffstat (limited to 'pages/en/anime')
-rw-r--r--pages/en/anime/[...id].js11
-rw-r--r--pages/en/anime/recently-watched.js7
-rw-r--r--pages/en/anime/watch/[...info].js23
3 files changed, 26 insertions, 15 deletions
diff --git a/pages/en/anime/[...id].js b/pages/en/anime/[...id].js
index 910bbc6..e2c0039 100644
--- a/pages/en/anime/[...id].js
+++ b/pages/en/anime/[...id].js
@@ -72,6 +72,8 @@ export default function Info({ info, color }) {
}
}
fetchData();
+
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [id, info, session?.user?.name]);
function handleOpen() {
@@ -143,7 +145,7 @@ export default function Info({ info, color }) {
stats={statuses?.value}
prg={progress}
max={info?.episodes}
- image={info}
+ info={info}
close={handleClose}
/>
)}
@@ -208,7 +210,12 @@ export default function Info({ info, color }) {
export async function getServerSideProps(ctx) {
const { id } = ctx.query;
- const API_URI = process.env.API_URI;
+
+ let API_URI;
+ API_URI = process.env.API_URI;
+ if (API_URI.endsWith("/")) {
+ API_URI = API_URI.slice(0, -1);
+ }
let cache;
diff --git a/pages/en/anime/recently-watched.js b/pages/en/anime/recently-watched.js
index c723394..6abf09d 100644
--- a/pages/en/anime/recently-watched.js
+++ b/pages/en/anime/recently-watched.js
@@ -6,12 +6,12 @@ import Skeleton from "react-loading-skeleton";
import Footer from "@/components/shared/footer";
import { getServerSession } from "next-auth";
import { authOptions } from "../../api/auth/[...nextauth]";
-import { toast } from "react-toastify";
import { ChevronRightIcon } from "@heroicons/react/24/outline";
import { useRouter } from "next/router";
import HistoryOptions from "@/components/home/content/historyOptions";
import Head from "next/head";
import MobileNav from "@/components/shared/MobileNav";
+import { toast } from "sonner";
export default function PopularAnime({ sessions }) {
const [data, setData] = useState(null);
@@ -105,11 +105,6 @@ export default function PopularAnime({ sessions }) {
if (data?.message === "Episode deleted") {
toast.success("Episode removed from history", {
position: "bottom-right",
- autoClose: 5000,
- hideProgressBar: false,
- closeOnClick: true,
- draggable: true,
- theme: "dark",
});
}
} else {
diff --git a/pages/en/anime/watch/[...info].js b/pages/en/anime/watch/[...info].js
index f918f86..a838b7f 100644
--- a/pages/en/anime/watch/[...info].js
+++ b/pages/en/anime/watch/[...info].js
@@ -29,8 +29,12 @@ export async function getServerSideProps(context) {
};
}
- const proxy = process.env.PROXY_URI;
- const disqus = process.env.DISQUS_SHORTNAME || null;
+ let proxy;
+ proxy = process.env.PROXY_URI;
+ if (proxy.endsWith("/")) {
+ proxy = proxy.slice(0, -1);
+ }
+ const disqus = process.env.DISQUS_SHORTNAME;
const [aniId, provider] = query?.info;
const watchId = query?.id;
@@ -114,7 +118,7 @@ export async function getServerSideProps(context) {
epiNumber: epiNumber || null,
dub: dub || null,
userData: userData?.[0] || null,
- info: data.data.Media || null,
+ info: data?.data?.Media || null,
proxy,
disqus,
},
@@ -179,9 +183,10 @@ export default function Watch({
if (episodes) {
const getProvider = episodes?.find((i) => i.providerId === provider);
- const episodeList = dub
- ? getProvider?.episodes?.filter((x) => x.hasDub === true)
- : getProvider?.episodes.slice(0, getMap?.episodes.length);
+ const episodeList = getProvider?.episodes.slice(
+ 0,
+ getMap?.episodes.length
+ );
const playingData = getMap?.episodes.find(
(i) => i.number === Number(epiNumber)
);
@@ -219,6 +224,7 @@ export default function Watch({
return () => {
setEpisodeNavigation(null);
};
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [sessions?.user?.name, epiNumber, dub]);
useEffect(() => {
@@ -287,6 +293,8 @@ export default function Watch({
});
setMarked(0);
};
+
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [provider, watchId, info?.id]);
useEffect(() => {
@@ -524,7 +532,7 @@ export default function Watch({
</div>
<div
id="secondary"
- className={`relative ${theaterMode ? "pt-2" : ""}`}
+ className={`relative ${theaterMode ? "pt-5" : "pt-4 lg:pt-0"}`}
>
<EpisodeLists
info={info}
@@ -534,6 +542,7 @@ export default function Watch({
watchId={watchId}
episode={episodesList}
artStorage={artStorage}
+ track={episodeNavigation}
dub={dub}
/>
</div>