mirror of
https://github.com/NoCrypt/migu.git
synced 2026-03-28 21:38:42 +00:00
fix: noauth, anilist login
This commit is contained in:
parent
29059d1caa
commit
00cb3deca0
3 changed files with 12 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Miru",
|
||||
"version": "3.5.2",
|
||||
"version": "3.5.3",
|
||||
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
||||
"description": "Stream anime torrents, real-time with no waiting for downloads.",
|
||||
"main": "src/index.js",
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@
|
|||
newSeasons: {
|
||||
title: 'Sequels You Missed',
|
||||
data: (async () => {
|
||||
if (!alToken) return
|
||||
const { data } = await alRequest({ method: 'NewSeasons' })
|
||||
const res = data.MediaListCollection.lists[0]
|
||||
return res?.entries?.flatMap(({ media }) => {
|
||||
|
|
|
|||
|
|
@ -92,14 +92,16 @@ const handleRequest = limiter.wrap(async opts => {
|
|||
return json
|
||||
})
|
||||
|
||||
export let alID = !!alToken
|
||||
alID = alRequest({ method: 'Viewer', token: alToken }).then(result => {
|
||||
const lists = result?.data?.Viewer?.mediaListOptions?.animeList?.customLists || []
|
||||
if (!lists.includes('Watched using Miru')) {
|
||||
alRequest({ method: 'CustomList', lists })
|
||||
}
|
||||
return result
|
||||
})
|
||||
export let alID = null
|
||||
if (alToken) {
|
||||
alID = alRequest({ method: 'Viewer', token: alToken }).then(result => {
|
||||
const lists = result?.data?.Viewer?.mediaListOptions?.animeList?.customLists || []
|
||||
if (!lists.includes('Watched using Miru')) {
|
||||
alRequest({ method: 'CustomList', lists })
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
|
||||
function printError (error) {
|
||||
console.warn(error)
|
||||
|
|
|
|||
Loading…
Reference in a new issue