diff options
| author | Fuwn <[email protected]> | 2023-10-20 16:54:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-10-20 16:54:53 -0700 |
| commit | 45c128e0be6bfaeefd809c745275ee8d9798ff4c (patch) | |
| tree | f9d980e56e3aa909f2f548c36c74ab3a1b05f1c1 /src | |
| parent | feat(settings): change to checkbox (diff) | |
| download | due.moe-45c128e0be6bfaeefd809c745275ee8d9798ff4c.tar.xz due.moe-45c128e0be6bfaeefd809c745275ee8d9798ff4c.zip | |
feat(manga): disable chapter guessing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/List/Template/MangaListTemplate.svelte | 4 | ||||
| -rw-r--r-- | src/lib/Media/manga.ts | 13 | ||||
| -rw-r--r-- | src/routes/settings/+page.svelte | 9 |
3 files changed, 21 insertions, 5 deletions
diff --git a/src/lib/List/Template/MangaListTemplate.svelte b/src/lib/List/Template/MangaListTemplate.svelte index 9823f97f..a0b48bdf 100644 --- a/src/lib/List/Template/MangaListTemplate.svelte +++ b/src/lib/List/Template/MangaListTemplate.svelte @@ -69,7 +69,9 @@ ($settings.displayNotStarted === true ? 0 : 1) ); let finalMedia = releasingMedia; - const chapterPromises = finalMedia.map((m: Media) => chapterCount(identity, m)); + const chapterPromises = finalMedia.map((m: Media) => + chapterCount(identity, m, $settings.disableGuessing) + ); const chapterCounts = await Promise.all(chapterPromises); finalMedia.forEach((m: Media, i) => { diff --git a/src/lib/Media/manga.ts b/src/lib/Media/manga.ts index 9d0e08a6..3c0cf837 100644 --- a/src/lib/Media/manga.ts +++ b/src/lib/Media/manga.ts @@ -14,7 +14,8 @@ export const pruneAllManga = async () => { export const chapterCount = async ( identity: UserIdentity, manga: Media, - preferActivity = false + disableGuessing: boolean + // preferActivity = false ): Promise<number | null> => { const chapters = await chapterDatabase.chapters.get(manga.id); @@ -22,11 +23,15 @@ export const chapterCount = async ( return chapters.chapters === -1 ? null : chapters.chapters; } - if (preferActivity) { - return await recentMediaActivities(identity, manga); - } + // if (preferActivity) { + // return await recentMediaActivities(identity, manga); + // } const tryRecentMediaActivities = async () => { + if (disableGuessing) { + return null; + } + const anilistData = await recentMediaActivities(identity, manga); await chapterDatabase.chapters.put({ diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte index ca27dfe9..0435a862 100644 --- a/src/routes/settings/+page.svelte +++ b/src/routes/settings/+page.svelte @@ -82,6 +82,15 @@ Round down to the nearest whole number. 50/50.6 would <b>not</b> be due </SettingHint> </SettingCheckboxToggle> + + <br /> + + <SettingCheckboxToggle setting="disableGuessing" text="Disable informed chapter estimation"> + <SettingHint lineBreak> + Enabling this setting will disable light novel chapter counts and may cause inaccuracy in + unresolved manga chapter counts + </SettingHint> + </SettingCheckboxToggle> </details> <p /> |