aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-17 04:42:55 -0800
committerFuwn <[email protected]>2023-12-17 04:42:55 -0800
commit9ad5f28246db93f6ef72e25d8b477e4f11865ddb (patch)
tree46b7505e35070d3e33f2844f53131b2da3db8dd4 /src/lib
parentrefactor(manga): move cache (diff)
downloaddue.moe-9ad5f28246db93f6ef72e25d8b477e4f11865ddb.tar.xz
due.moe-9ad5f28246db93f6ef72e25d8b477e4f11865ddb.zip
refactor(manga): move chapters and volumes
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/List/Manga/CleanMangaList.svelte2
-rw-r--r--src/lib/List/Manga/MangaListTemplate.svelte2
-rw-r--r--src/lib/Media/Manga/chapters.ts (renamed from src/lib/Media/manga.ts)9
-rw-r--r--src/lib/Media/Manga/volumes.ts5
-rw-r--r--src/lib/Tools/Wrapped.svelte2
5 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte
index 40082809..b0e7947e 100644
--- a/src/lib/List/Manga/CleanMangaList.svelte
+++ b/src/lib/List/Manga/CleanMangaList.svelte
@@ -1,7 +1,7 @@
<script lang="ts">
import type { Media } from '$lib/AniList/media';
import Error from '$lib/Error.svelte';
- import { volumeCount } from '$lib/Media/manga';
+ import { volumeCount } from '$lib/Media/Manga/volumes';
import { outboundLink } from '$lib/Media/media';
import settings from '../../../stores/settings';
import ListTitle from '../ListTitle.svelte';
diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte
index 822c7343..5fdb2bf5 100644
--- a/src/lib/List/Manga/MangaListTemplate.svelte
+++ b/src/lib/List/Manga/MangaListTemplate.svelte
@@ -2,7 +2,7 @@
import { mediaListCollection, Type, type Media } from '$lib/AniList/media';
import type { UserIdentity, AniListAuthorisation } from '$lib/AniList/identity';
import { onDestroy, onMount } from 'svelte';
- import { chapterCount } from '$lib/Media/manga';
+ 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';
diff --git a/src/lib/Media/manga.ts b/src/lib/Media/Manga/chapters.ts
index 95d45697..4e2971c9 100644
--- a/src/lib/Media/manga.ts
+++ b/src/lib/Media/Manga/chapters.ts
@@ -1,10 +1,7 @@
import { recentMediaActivities, type Media } from '$lib/AniList/media';
-import settings from '../../stores/settings';
-import type { UserIdentity } from '../AniList/identity';
-import { chapterDatabase } from './Manga/database';
-
-export const volumeCount = async (manga: Media): Promise<number | null> =>
- (await chapterDatabase.chapters.get(manga.id))?.volumes as number | null;
+import settings from '../../../stores/settings';
+import type { UserIdentity } from '../../AniList/identity';
+import { chapterDatabase } from './database';
export const chapterCount = async (
identity: UserIdentity,
diff --git a/src/lib/Media/Manga/volumes.ts b/src/lib/Media/Manga/volumes.ts
new file mode 100644
index 00000000..ea2c3ed9
--- /dev/null
+++ b/src/lib/Media/Manga/volumes.ts
@@ -0,0 +1,5 @@
+import type { Media } from '$lib/AniList/media';
+import { chapterDatabase } from './database';
+
+export const volumeCount = async (manga: Media): Promise<number | null> =>
+ (await chapterDatabase.chapters.get(manga.id))?.volumes as number | null;
diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte
index e18f2359..41f904d9 100644
--- a/src/lib/Tools/Wrapped.svelte
+++ b/src/lib/Tools/Wrapped.svelte
@@ -17,7 +17,7 @@
import { page } from '$app/stores';
import { clearAllParameters } from './tool.js';
import { env } from '$env/dynamic/public';
- import { estimatedDayReading } from '$lib/Media/manga.js';
+ import { estimatedDayReading } from '$lib/Media/Manga/chapters.js';
export let user: AniListAuthorisation;