mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-20 08:02:12 +00:00
fix: scoring
This commit is contained in:
parent
529ed945aa
commit
6c7032a411
2 changed files with 8 additions and 5 deletions
|
|
@ -222,7 +222,7 @@ export default class Helper {
|
|||
// check episode range, safety check if `failed` didn't catch this
|
||||
if (videoEpisode > mediaEpisode) return
|
||||
|
||||
const lists = media.mediaListEntry?.customLists.filter(list => list.enabled).map(list => list.name) || []
|
||||
const lists = media.mediaListEntry?.customLists?.filter(list => list.enabled).map(list => list.name) || []
|
||||
|
||||
const status = media.mediaListEntry?.status === 'REPEATING' ? 'REPEATING' : 'CURRENT'
|
||||
const progress = media.mediaListEntry?.progress
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@
|
|||
const description = `${anilistClient.title(media)} has been deleted from your list.`
|
||||
printToast(res, description, false, false)
|
||||
|
||||
if (res) media.mediaListEntry = undefined
|
||||
|
||||
if (Helper.getUser().sync) { // handle profile syncing
|
||||
const mediaId = media.id
|
||||
const profiles = JSON.parse(localStorage.getItem('profiles')) || []
|
||||
|
|
@ -73,15 +75,13 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (res) media.mediaListEntry = undefined
|
||||
}
|
||||
}
|
||||
|
||||
async function saveEntry() {
|
||||
if (!status.includes('NOT IN LIST')) {
|
||||
const fuzzyDate = Helper.getFuzzyDate(media, status)
|
||||
const lists = media.mediaListEntry?.customLists.filter(list => list.enabled).map(list => list.name) || []
|
||||
const lists = media.mediaListEntry?.customLists?.filter(list => list.enabled).map(list => list.name) || []
|
||||
if (!lists.includes('Watched using Miru')) {
|
||||
lists.push('Watched using Miru')
|
||||
}
|
||||
|
|
@ -95,7 +95,10 @@
|
|||
lists,
|
||||
...fuzzyDate
|
||||
}
|
||||
let res = await Helper.entry(media, variables)
|
||||
const res = await Helper.entry(media, variables)
|
||||
|
||||
if (res?.data?.SaveMediaListEntry) { media.mediaListEntry = res?.data?.SaveMediaListEntry }
|
||||
|
||||
const description = `Title: ${anilistClient.title(media)}\nStatus: ${Helper.statusName[status]}\nEpisode: ${episode} / ${totalEpisodes}${score !== 0 ? `\nYour Score: ${score}` : ''}`
|
||||
printToast(res, description, true, false)
|
||||
if (Helper.getUser().sync) { // handle profile syncing
|
||||
|
|
|
|||
Loading…
Reference in a new issue