From b1f97fdf69f03328055860b56ce75983c9ea744d Mon Sep 17 00:00:00 2001
From: schroda <50052685+schroda@users.noreply.github.com>
Date: Sat, 20 Apr 2024 02:40:10 +0200
Subject: [PATCH] Chapters download menu download ahead only if required
Instead of checking if download ahead is required because not enough unread downloaded chapters existed, it just downloaded the next n unread undownloaded chapters
---
.../ChaptersDownloadActionMenuItems.tsx | 5 +--
src/lib/data/Mangas.ts | 32 ++++++++++++-------
2 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/src/components/chapter/ChaptersDownloadActionMenuItems.tsx b/src/components/chapter/ChaptersDownloadActionMenuItems.tsx
index 51029835..83c855d6 100644
--- a/src/components/chapter/ChaptersDownloadActionMenuItems.tsx
+++ b/src/components/chapter/ChaptersDownloadActionMenuItems.tsx
@@ -34,8 +34,9 @@ export const ChaptersDownloadActionMenuItems = ({
settings: { downloadAheadLimit },
} = useMetadataServerSettings();
- const handleSelect = (size?: number, onlyUnread: boolean = true) => {
+ const handleSelect = (size?: number, onlyUnread: boolean = true, downloadAhead: boolean = false) => {
Mangas.performAction('download', mangaIds, {
+ downloadAhead,
onlyUnread,
size,
}).catch(defaultPromiseErrorHandler('ChapterDownloadButton::handleSelect'));
@@ -56,7 +57,7 @@ export const ChaptersDownloadActionMenuItems = ({
-