From 8562ba4280c575b3f04df598b7954a2d28b19e50 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 27 Sep 2023 23:33:01 -0700 Subject: feat(wrapped): initial wrapped prototype --- src/lib/AniList/media.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/lib/AniList/media.ts') diff --git a/src/lib/AniList/media.ts b/src/lib/AniList/media.ts index 6187094d..d9ce5e57 100644 --- a/src/lib/AniList/media.ts +++ b/src/lib/AniList/media.ts @@ -28,10 +28,14 @@ export interface Media { mediaListEntry?: { progress: number; status: string; + score: number; }; startDate: { year: number; }; + coverImage: { + extraLarge: string; + }; } export const flattenLists = (lists: { entries: { media: Media }[] }[]) => { @@ -59,7 +63,8 @@ export const mediaListCollection = async ( type: Type, mediaCache: string | undefined, currentLastPruneAt: string | number, - forcePrune = false + forcePrune = false, + includeCompleted = false ): Promise => { let currentCacheMinutes; @@ -106,7 +111,7 @@ export const mediaListCollection = async ( body: JSON.stringify({ query: `{ MediaListCollection(userId: ${userIdentity.id}, type: ${ type === Type.Anime ? 'ANIME' : 'MANGA' - }, status_not_in: [ COMPLETED ]) { + }${includeCompleted ? '' : ', status_not_in: [ COMPLETED ]'}) { lists { entries { media { id status @@ -115,8 +120,9 @@ export const mediaListCollection = async ( format title { romaji english native } nextAiringEpisode { episode timeUntilAiring } - mediaListEntry { progress status } + mediaListEntry { progress status score(format: POINT_100) } startDate { year } + coverImage { extraLarge } } } } } }` -- cgit v1.2.3