diff options
| author | Fuwn <[email protected]> | 2023-12-22 03:38:02 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-12-22 03:38:02 -0800 |
| commit | 626142b8d3c7115803bfaf60700a486d79c0aea4 (patch) | |
| tree | 36419613b4265282b82fff53135c9048b6f98171 /src/lib/Media/Manga/chapters.ts | |
| parent | feat(wrapped): commit activities to database (diff) | |
| download | due.moe-626142b8d3c7115803bfaf60700a486d79c0aea4.tar.xz due.moe-626142b8d3c7115803bfaf60700a486d79c0aea4.zip | |
refactor(manga): move chapters to database module
Diffstat (limited to 'src/lib/Media/Manga/chapters.ts')
| -rw-r--r-- | src/lib/Media/Manga/chapters.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/Media/Manga/chapters.ts b/src/lib/Media/Manga/chapters.ts index c9e33c48..2e3c6678 100644 --- a/src/lib/Media/Manga/chapters.ts +++ b/src/lib/Media/Manga/chapters.ts @@ -1,7 +1,7 @@ import { recentMediaActivities, type Media } from '$lib/AniList/media'; import settings from '../../../stores/settings'; import type { UserIdentity } from '../../AniList/identity'; -import { chapterDatabase } from './database'; +import { database } from '../../Database/chapters'; export const chapterCount = async ( identity: UserIdentity, @@ -9,7 +9,7 @@ export const chapterCount = async ( disableGuessing: boolean // preferActivity = false ): Promise<number | null> => { - const chapters = await chapterDatabase.chapters.get(manga.id); + const chapters = await database.chapters.get(manga.id); if (chapters !== undefined) return chapters.chapters === -1 ? null : chapters.chapters; @@ -26,7 +26,7 @@ export const chapterCount = async ( settings.get().calculateGuessMethod ); - await chapterDatabase.chapters.put({ + await database.chapters.put({ id: manga.id, chapters: anilistData ? anilistData : -1, volumes: null @@ -103,7 +103,7 @@ export const chapterCount = async ( if (lastChapter == 0) lastChapter = -1; - await chapterDatabase.chapters.put({ + await database.chapters.put({ id: manga.id, chapters: Number(lastChapter), volumes: completedVolumes |