aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Database
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/Database
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/Database')
-rw-r--r--src/lib/Database/chapters.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/Database/chapters.ts b/src/lib/Database/chapters.ts
new file mode 100644
index 00000000..0f77f0a0
--- /dev/null
+++ b/src/lib/Database/chapters.ts
@@ -0,0 +1,22 @@
+import Dexie, { type Table } from 'dexie';
+
+export interface Chapter {
+ id: number;
+ chapters: number | null;
+ volumes: number | null;
+}
+
+export class ChapterDatabase extends Dexie {
+ chapters: Table<Chapter>;
+
+ constructor() {
+ super('chapters');
+ this.version(1).stores({
+ chapters: 'id, chapters, volumes'
+ });
+
+ this.chapters = this.table('chapters');
+ }
+}
+
+export const database = new ChapterDatabase();