mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-06 01:29:57 +00:00
manual episode autocomplete
This commit is contained in:
parent
276c826c0c
commit
0c3fb212de
3 changed files with 14 additions and 4 deletions
|
|
@ -455,7 +455,7 @@
|
|||
<script src="js/rangeParser.js"></script>
|
||||
<script src="js/idbkv-chunk-store.js"></script>
|
||||
<script src="js/torrentHandler.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/matroska-subtitles@3.2.2/dist/matroska-subtitles.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/matroska-subtitles@3.2.3/dist/matroska-subtitles.min.js"></script>
|
||||
<script src="js/subtitles-octopus.js"></script>
|
||||
<script src="js/subtitleOctopus.js"></script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ async function alRequest(searchName, method) {
|
|||
return json
|
||||
}
|
||||
function alEntry() {
|
||||
if (playerData.nowPlaying && localStorage.getItem("ALtoken")) {
|
||||
if (playerData.nowPlaying && playerData.nowPlaying[0] && localStorage.getItem("ALtoken")) {
|
||||
let query = `
|
||||
mutation ($id: Int, $status: MediaListStatus, $episode: Int) {
|
||||
SaveMediaListEntry (mediaId: $id, status: $status, progress: $episode) {
|
||||
|
|
|
|||
|
|
@ -668,9 +668,19 @@ if ('mediaSession' in navigator) {
|
|||
|
||||
//AL entry auto add
|
||||
function checkCompletion() {
|
||||
if (!playerData.watched && settings.other2 && typeof video !== 'undefined' && video.duration - 180 < video.currentTime) {
|
||||
if (!playerData.watched && typeof video !== 'undefined' && video.duration - 180 < video.currentTime && playerData.nowPlaying && playerData.nowPlaying[0]) {
|
||||
if(settings.other2){
|
||||
alEntry()
|
||||
} else{
|
||||
halfmoon.initStickyAlert({
|
||||
content: `Do You Want To Mark <br><b>${playerData.nowPlaying[0].title.userPreferred}</b><br>Episode ${playerData.nowPlaying[1]} As Completed?<br>
|
||||
<button class="btn btn-sm btn-square btn-success mt-5" onclick="alEntry()">✓</button>
|
||||
<button class="btn btn-sm btn-square mt-5" data-dismiss="alert" type="button" aria-label="Close"><span aria-hidden="true">X</span></button>`,
|
||||
title: "Episode Complete",
|
||||
timeShown: 180000
|
||||
})
|
||||
}
|
||||
playerData.watched = true
|
||||
alEntry()
|
||||
}
|
||||
}
|
||||
cleanupVideo()
|
||||
Loading…
Reference in a new issue