diff options
| author | Fuwn <[email protected]> | 2024-10-09 00:41:20 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-09 00:41:43 -0700 |
| commit | 998b63a35256ac985a5a2714dd1ca451af4dfd8a (patch) | |
| tree | 50796121a9d5ab0330fdc5d7e098bda2860d9726 /src/lib/Media/Anime/cache.ts | |
| parent | feat(graphql): add badgeCount field (diff) | |
| download | due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.tar.xz due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.zip | |
chore(prettier): use spaces instead of tabs
Diffstat (limited to 'src/lib/Media/Anime/cache.ts')
| -rw-r--r-- | src/lib/Media/Anime/cache.ts | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lib/Media/Anime/cache.ts b/src/lib/Media/Anime/cache.ts index a47a655e..9aabb2ab 100644 --- a/src/lib/Media/Anime/cache.ts +++ b/src/lib/Media/Anime/cache.ts @@ -5,27 +5,27 @@ import lastPruneTimes from '$stores/lastPruneTimes'; import type { AniListAuthorisation, UserIdentity } from '../../Data/AniList/identity'; export const cleanCache = (user: AniListAuthorisation, identity: UserIdentity) => - mediaListCollection(user, identity, Type.Anime, get(anime), get(lastPruneTimes).anime, { - forcePrune: true - }); + mediaListCollection(user, identity, Type.Anime, get(anime), get(lastPruneTimes).anime, { + forcePrune: true + }); export const incrementMediaProgress = ( - id: number, - progress: number | undefined, - user: AniListAuthorisation, - callback: () => void + id: number, + progress: number | undefined, + user: AniListAuthorisation, + callback: () => void ) => { - fetch('https://graphql.anilist.co', { - method: 'POST', - headers: { - Authorization: `${user.tokenType} ${user.accessToken}`, - 'Content-Type': 'application/json', - Accept: 'application/json' - }, - body: JSON.stringify({ - query: `mutation { SaveMediaListEntry(mediaId: ${id}, progress: ${ - (progress || 0) + 1 - }) { id } }` - }) - }).then(callback); + fetch('https://graphql.anilist.co', { + method: 'POST', + headers: { + Authorization: `${user.tokenType} ${user.accessToken}`, + 'Content-Type': 'application/json', + Accept: 'application/json' + }, + body: JSON.stringify({ + query: `mutation { SaveMediaListEntry(mediaId: ${id}, progress: ${ + (progress || 0) + 1 + }) { id } }` + }) + }).then(callback); }; |