aboutsummaryrefslogtreecommitdiff
path: root/components/anime/watch/primarySide.js
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-08-09 15:11:53 +0700
committerGitHub <[email protected]>2023-08-09 15:11:53 +0700
commitbae1f53877c3447d3ba940f823e5a8a097f5b22c (patch)
tree98abb195bcad6f3e6c61c76c62fc238f227b0ead /components/anime/watch/primarySide.js
parentUpdate package-lock.json (diff)
downloadmoopa-3.9.0.tar.xz
moopa-3.9.0.zip
Update v3.9.0 - Merged Beta to Main (#41)v3.9.0
* initial commit * Update_v.3.6.7-beta-v1.2 * Update_v.3.6.7-beta-v1.3 * Update_v.3.6.7-beta-v1.3 > update API * Fixed mediaList won't update * added .env disqus shortname * Update_v3.6.7-beta-v1.4 >Implementing database * Create main.yml * Update v3.6.7-beta-v1.5 small patch * title home page * Update content.js * Delete db-test.js * Update content.js * Update home page card * Update v3.7.0 * Update v3.7.1-beta > migrating backend to main code > fixed schedule component * Update v3.8.0 > Added dub options > Moved schedule backend * Update v.3.8.1 > Fixed episodes on watch page isn't dubbed * Update v3.8.1-patch-1 * Update v3.8.1-patch-2 > Another patch for dub * Update v3.8.2 > Removed prisma configuration for database since it's not stable yet * Update v3.8.3 > Fixed different provider have same id * Update v.3.8.3 > Fixed player bug where the controls won't hide after updating anilist progress * Update v3.8.4-patch-2 * Update v3.8.5 > Update readme.md > Update .env.example * Update next.config.js * small adjusment info page * Update v3.8.6 > Minor update for Android 13 user * Update v3.8.7 > Added prev and next button to mediaSession * Update v3.8.7-beta-v2 * Beta v2 (#37) * Update schema.prisma * Update schema.prisma * Update schema.prisma * Update 3.9.0-beta-v2.1 > Implemented database for storing user Watch List and settings > Added buttons to auto-play next episodes * Update v3.9.0-beta-v2.2 * Update README.md --------- Co-authored-by: Chitraksh Maheshwari <[email protected]>
Diffstat (limited to 'components/anime/watch/primarySide.js')
-rw-r--r--components/anime/watch/primarySide.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/components/anime/watch/primarySide.js b/components/anime/watch/primarySide.js
index fa12711..2e28563 100644
--- a/components/anime/watch/primarySide.js
+++ b/components/anime/watch/primarySide.js
@@ -26,6 +26,7 @@ export default function PrimarySide({
disqus,
setOnList,
episodeList,
+ timeWatched,
}) {
const [episodeData, setEpisodeData] = useState();
const [open, setOpen] = useState(false);
@@ -35,8 +36,6 @@ export default function PrimarySide({
useEffect(() => {
setLoading(true);
- setEpisodeData();
- setSkip();
async function fetchData() {
if (info) {
const { data } = await axios.get(
@@ -47,15 +46,15 @@ export default function PrimarySide({
`https://api.aniskip.com/v2/skip-times/${info.idMal}/${parseInt(
epiNumber
)}?types[]=ed&types[]=mixed-ed&types[]=mixed-op&types[]=op&types[]=recap&episodeLength=`
- ).then((r) => {
- if (!r.ok) {
- switch (r.status) {
+ ).then((res) => {
+ if (!res.ok) {
+ switch (res.status) {
case 404: {
return null;
}
}
}
- return r.json();
+ return res.json();
});
const op =
@@ -72,6 +71,10 @@ export default function PrimarySide({
}
fetchData();
+ return () => {
+ setEpisodeData();
+ setSkip();
+ };
}, [providerId, watchId, info]);
useEffect(() => {
@@ -141,7 +144,9 @@ export default function PrimarySide({
skip={skip}
proxy={proxy}
aniId={info.id}
+ aniTitle={info.title?.romaji || info.title?.english}
track={navigation}
+ timeWatched={timeWatched}
/>
)
) : (