aboutsummaryrefslogtreecommitdiff
path: root/src/lib/List
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-22 03:38:02 -0800
committerFuwn <[email protected]>2023-12-22 03:38:02 -0800
commit626142b8d3c7115803bfaf60700a486d79c0aea4 (patch)
tree36419613b4265282b82fff53135c9048b6f98171 /src/lib/List
parentfeat(wrapped): commit activities to database (diff)
downloaddue.moe-626142b8d3c7115803bfaf60700a486d79c0aea4.tar.xz
due.moe-626142b8d3c7115803bfaf60700a486d79c0aea4.zip
refactor(manga): move chapters to database module
Diffstat (limited to 'src/lib/List')
-rw-r--r--src/lib/List/Manga/MangaListTemplate.svelte10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte
index 9a66ad4a..f30cb520 100644
--- a/src/lib/List/Manga/MangaListTemplate.svelte
+++ b/src/lib/List/Manga/MangaListTemplate.svelte
@@ -5,7 +5,7 @@
import { chapterCount } from '$lib/Media/Manga/chapters';
import { pruneAllManga } from '$lib/Media/Manga/cache';
import manga from '../../../stores/manga';
- import { chapterDatabase } from '$lib/Media/Manga/database';
+ import { database } from '$lib/Database/chapters';
import settings from '../../../stores/settings';
import lastPruneTimes from '../../../stores/lastPruneTimes';
import ListTitle from '../ListTitle.svelte';
@@ -54,9 +54,7 @@
) {
lastPruneTimes.setKey('chapters', currentDate.getTime());
(async () => {
- await chapterDatabase.chapters.bulkDelete(
- (await chapterDatabase.chapters.toArray()).map((m) => m.id)
- );
+ await database.chapters.bulkDelete((await database.chapters.toArray()).map((m) => m.id));
})();
}
}
@@ -73,7 +71,7 @@
let finalMedia = releasingMedia;
const progressStep = 100 / finalMedia.length;
const chapterPromises = finalMedia.map((m: Media) =>
- chapterDatabase.chapters.get(m.id).then((c) => {
+ database.chapters.get(m.id).then((c) => {
if (c !== undefined) return chapterCount(identity, m, $settings.calculateGuessingDisabled);
else {
// A = On 1 second interval,
@@ -133,7 +131,7 @@
pendingUpdate = id;
lastUpdatedMedia = id;
- await chapterDatabase.chapters.delete(id);
+ await database.chapters.delete(id);
await fetch(`/api/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`).then(() => {
previousMangaList = media;