diff options
| author | Fuwn <[email protected]> | 2023-09-14 14:41:09 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-14 14:41:09 -0700 |
| commit | 569defd379a3ea05d1ad9f551d9725129580d98a (patch) | |
| tree | 7178fc8b52a68c012bf206c53ef972005c52a0d8 /src/lib/Media | |
| parent | refactor: move media to folder (diff) | |
| download | due.moe-569defd379a3ea05d1ad9f551d9725129580d98a.tar.xz due.moe-569defd379a3ea05d1ad9f551d9725129580d98a.zip | |
refactor(media): move chapters in
Diffstat (limited to 'src/lib/Media')
| -rw-r--r-- | src/lib/Media/chapters.ts | 21 | ||||
| -rw-r--r-- | src/lib/Media/manga.ts | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/lib/Media/chapters.ts b/src/lib/Media/chapters.ts new file mode 100644 index 00000000..d580e6fa --- /dev/null +++ b/src/lib/Media/chapters.ts @@ -0,0 +1,21 @@ +import Dexie, { type Table } from 'dexie'; + +export interface Chapter { + id: number; + chapters: number | null; +} + +export class ChapterDatabase extends Dexie { + chapters: Table<Chapter>; + + constructor() { + super('chapterDatabase'); + this.version(1).stores({ + chapters: 'id, chapters' + }); + + this.chapters = this.table('chapters'); + } +} + +export const chapterDatabase = new ChapterDatabase(); diff --git a/src/lib/Media/manga.ts b/src/lib/Media/manga.ts index 7150bf60..acaccefc 100644 --- a/src/lib/Media/manga.ts +++ b/src/lib/Media/manga.ts @@ -1,6 +1,6 @@ import { recentMediaActivities, type Media } from '$lib/AniList/media'; import type { UserIdentity } from '../AniList/identity'; -import { chapterDatabase } from '../chapterDatabase'; +import { chapterDatabase } from './chapters'; export const chapterCount = async ( identity: UserIdentity, |