diff options
| author | Fuwn <[email protected]> | 2023-09-27 23:33:01 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-27 23:33:01 -0700 |
| commit | 8562ba4280c575b3f04df598b7954a2d28b19e50 (patch) | |
| tree | eaa43530441522b5104a1fd1e404ce6b663fc9b0 /src/lib/AniList/media.ts | |
| parent | fix(anime): template increment render (diff) | |
| download | due.moe-8562ba4280c575b3f04df598b7954a2d28b19e50.tar.xz due.moe-8562ba4280c575b3f04df598b7954a2d28b19e50.zip | |
feat(wrapped): initial wrapped prototype
Diffstat (limited to 'src/lib/AniList/media.ts')
| -rw-r--r-- | src/lib/AniList/media.ts | 12 |
1 files changed, 9 insertions, 3 deletions
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<Media[]> => { 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 } } } } } }` |