diff options
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, |