mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-05 00:59:49 +00:00
fix: undefined debug
This commit is contained in:
parent
342f3d610a
commit
6768d67e7b
2 changed files with 4 additions and 3 deletions
|
|
@ -28,6 +28,7 @@ export default class SectionsManager {
|
|||
return (page = 1, perPage = 50, search = variables) => {
|
||||
const hideSubs = search.hideSubs ? { idMal: malDubs.dubLists.value.dubbed } : {}
|
||||
const res = (search.hideMyAnime && Helper.isAuthorized()) ? Helper.userLists(search).then(res => {
|
||||
// anilist queries do not support mix and match, you have to use the same id includes as excludes, id_not_in cannot be used with idMal_in.
|
||||
const hideMyAnime = Helper.isAniAuth() ? { [Object.keys(hideSubs).length > 0 ? 'idMal_not' : 'id_not']: Array.from(new Set(res.data.MediaListCollection.lists.filter(({ status }) => search.hideStatus.includes(status)).flatMap(list => list.entries.map(({ media }) => (Object.keys(hideSubs).length > 0 ? media.idMal : media.id))))) }
|
||||
: {idMal_not: res.data.MediaList.filter(({ node }) => search.hideStatus.includes(Helper.statusMap(node.my_list_status.status))).map(({ node }) => node.id)}
|
||||
return anilistClient.search({ page, perPage, ...hideSubs, ...hideMyAnime, ...SectionsManager.sanitiseObject(search) })
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@
|
|||
}
|
||||
|
||||
function fileListToDebug (files) {
|
||||
return files.map(({ name, media, url }) => `\n${name} ${media?.parseObject.anime_title} ${media?.parseObject.episode_number} ${media?.media?.title.userPreferred} ${media?.episode}`).join('')
|
||||
return files?.map(({ name, media, url }) => `\n${name} ${media?.parseObject?.anime_title} ${media?.parseObject?.episode_number} ${media?.media?.title?.userPreferred} ${media?.episode}`).join('')
|
||||
}
|
||||
|
||||
async function handleFiles (files) {
|
||||
|
|
@ -149,7 +149,7 @@
|
|||
|
||||
if (!nowPlaying) {
|
||||
nowPlaying = findPreferredPlaybackMedia(videoFiles)
|
||||
debug(`Found preferred playback media: ${nowPlaying.media?.id}:${nowPlaying.media?.title.userPreferred} ${nowPlaying.episode}`)
|
||||
debug(`Found preferred playback media: ${nowPlaying?.media?.id}:${nowPlaying?.media?.title?.userPreferred} ${nowPlaying?.episode}`)
|
||||
}
|
||||
|
||||
const filtered = nowPlaying?.media && videoFiles.filter(file => file.media?.media?.id && file.media?.media?.id === nowPlaying.media.id)
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
result = filtered
|
||||
} else {
|
||||
const max = highestOccurence(videoFiles, file => file.media.parseObject.anime_title).media.parseObject.anime_title
|
||||
debug(`Highest occurence anime title: ${max}`)
|
||||
debug(`Highest occurrence anime title: ${max}`)
|
||||
result = videoFiles.filter(file => file.media.parseObject.anime_title === max)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue