diff options
| author | Factiven <[email protected]> | 2023-04-17 23:20:32 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-04-17 23:20:32 +0700 |
| commit | 47a18c5e0da56d1c98a7e367dddfb0b0fc71b7fa (patch) | |
| tree | 2ee854abd7522f53e9c143dff77a54f7445d087e | |
| parent | 7th fixes (diff) | |
| download | moopa-47a18c5e0da56d1c98a7e367dddfb0b0fc71b7fa.tar.xz moopa-47a18c5e0da56d1c98a7e367dddfb0b0fc71b7fa.zip | |
8th fixes
| -rw-r--r-- | components/videoPlayer.js | 8 | ||||
| -rw-r--r-- | lib/useAnilist.js | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/components/videoPlayer.js b/components/videoPlayer.js index 5d35874..b5f8412 100644 --- a/components/videoPlayer.js +++ b/components/videoPlayer.js @@ -83,16 +83,18 @@ export default function VideoPlayer({ } }); - art.on("destroy", () => { + art.on("video:timeupdate", () => { const currentTime = art.currentTime; const duration = art.duration; const percentage = currentTime / duration; + // console.log(percentage); + if (percentage >= 0.9) { // use >= instead of > markProgress(aniId, progress, stats); - } else { - return; + art.off("video:timeupdate"); + console.log("Video progress marked"); } }); diff --git a/lib/useAnilist.js b/lib/useAnilist.js index acae54f..5f21783 100644 --- a/lib/useAnilist.js +++ b/lib/useAnilist.js @@ -187,7 +187,7 @@ export function useAniList(session, stats) { }), }); if (response.ok) { - // console.log(`Progress Updated: ${progress}`); + console.log(`Progress Updated: ${progress}`); } else if (response.status === 401) { console.log("Unauthorized"); } else if (response.status === 400) { |