diff options
Diffstat (limited to 'src/lib/anime.ts')
| -rw-r--r-- | src/lib/anime.ts | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/anime.ts b/src/lib/anime.ts index 8547882f..2ebdf25e 100644 --- a/src/lib/anime.ts +++ b/src/lib/anime.ts @@ -1,4 +1,19 @@ -import type { Media } from './AniList/media'; +import { get } from 'svelte/store'; +import anime from '../stores/anime'; +import { mediaListCollection, type Media, Type } from './AniList/media'; +import lastPruneTimes from '../stores/lastPruneTimes'; +import type { AniListAuthorisation, UserIdentity } from './AniList/identity'; + +export const cleanCache = (user: AniListAuthorisation, identity: UserIdentity) => { + return mediaListCollection( + user, + identity, + Type.Anime, + get(anime), + get(lastPruneTimes).anime, + true + ); +}; export const totalEpisodes = (anime: Media) => { return anime.episodes === null ? '' : `<span style="opacity: 50%">/${anime.episodes}</span>`; |