aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/AniList/media.ts10
-rw-r--r--src/lib/List/Due/AnimeList.svelte2
-rw-r--r--src/lib/List/Due/MangaList.svelte8
3 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/AniList/media.ts b/src/lib/AniList/media.ts
index ebf8c72f..7cc42827 100644
--- a/src/lib/AniList/media.ts
+++ b/src/lib/AniList/media.ts
@@ -66,11 +66,11 @@ export const mediaListCollection = async (
currentCacheMinutes = value.cacheMinutes;
});
- if (String(currentLastPruneAt) == '') {
+ if (String(currentLastPruneAt) === '') {
if (type === Type.Anime) {
- lastPruneTimes.setKey('anime', new Date().getTime().toString());
+ lastPruneTimes.setKey('anime', new Date().getTime());
} else {
- lastPruneTimes.setKey('manga', new Date().getTime().toString());
+ lastPruneTimes.setKey('manga', new Date().getTime());
}
} else {
if (
@@ -79,10 +79,10 @@ export const mediaListCollection = async (
forcePrune
) {
if (type === Type.Anime) {
- lastPruneTimes.setKey('anime', new Date().getTime().toString());
+ lastPruneTimes.setKey('anime', new Date().getTime());
anime.set('');
} else {
- lastPruneTimes.setKey('manga', new Date().getTime().toString());
+ lastPruneTimes.setKey('manga', new Date().getTime());
manga.set('');
}
diff --git a/src/lib/List/Due/AnimeList.svelte b/src/lib/List/Due/AnimeList.svelte
index f70363f3..3079352b 100644
--- a/src/lib/List/Due/AnimeList.svelte
+++ b/src/lib/List/Due/AnimeList.svelte
@@ -27,7 +27,7 @@
$lastPruneTimes.anime,
true
);
- }, Number($settings.cacheMinutes || 10) * 1000 * 60);
+ }, $settings.cacheMinutes * 1000 * 60);
onMount(async () => {
startTime = performance.now();
diff --git a/src/lib/List/Due/MangaList.svelte b/src/lib/List/Due/MangaList.svelte
index 353d1895..90b2f497 100644
--- a/src/lib/List/Due/MangaList.svelte
+++ b/src/lib/List/Due/MangaList.svelte
@@ -20,7 +20,7 @@
startTime = performance.now();
endTime = -1;
mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $lastPruneTimes.manga);
- }, Number($settings.cacheMinutes || 30) * 1000 * 60);
+ }, $settings.cacheMinutes * 1000 * 60);
onMount(async () => {
startTime = performance.now();
@@ -40,16 +40,16 @@
}
if ($lastPruneTimes.chapters === 1) {
- lastPruneTimes.setKey('chapters', new Date().getTime().toString());
+ lastPruneTimes.setKey('chapters', new Date().getTime());
} else {
if (
(new Date().getTime() - $lastPruneTimes.chapters) / 1000 / 60 >
- Number($settings.cacheMangaMinutes)
+ $settings.cacheMangaMinutes
) {
const unresolved = await chapterDatabase.chapters.where('chapters').equals(-1).toArray();
const ids = unresolved.map((m) => m.id);
- lastPruneTimes.setKey('chapters', new Date().getTime().toString());
+ lastPruneTimes.setKey('chapters', new Date().getTime());
await chapterDatabase.chapters.bulkDelete(ids);
}
}