diff options
| author | Fuwn <[email protected]> | 2023-09-10 02:15:56 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-10 02:15:56 -0700 |
| commit | c81e430c62459255fe02a75d3794860acd02c3b8 (patch) | |
| tree | 46e2af1d8ba95b61d59b5b76eeac187582a2d764 /src/lib/anime.ts | |
| parent | refactor(anime): generalise clean cache (diff) | |
| download | due.moe-c81e430c62459255fe02a75d3794860acd02c3b8.tar.xz due.moe-c81e430c62459255fe02a75d3794860acd02c3b8.zip | |
refactor(anime): generalise update media
Diffstat (limited to 'src/lib/anime.ts')
| -rw-r--r-- | src/lib/anime.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/anime.ts b/src/lib/anime.ts index 2ebdf25e..c9bba378 100644 --- a/src/lib/anime.ts +++ b/src/lib/anime.ts @@ -15,6 +15,10 @@ export const cleanCache = (user: AniListAuthorisation, identity: UserIdentity) = ); }; +export const updateMedia = (id: number, progress: number | undefined, callback: () => void) => { + fetch(`/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`).then(callback); +}; + export const totalEpisodes = (anime: Media) => { return anime.episodes === null ? '' : `<span style="opacity: 50%">/${anime.episodes}</span>`; }; |