From ef9e65cf9a7a090611d223dc22c3872231dc5e51 Mon Sep 17 00:00:00 2001
From: schroda <50052685+schroda@users.noreply.github.com>
Date: Sun, 7 Jun 2026 13:23:27 +0200
Subject: [PATCH] Fix downloaded consideration of manga without any chapters
---
CHANGELOG.md | 3 ++-
.../manga/components/MangaActionMenuItems.tsx | 10 +++++-----
src/features/manga/services/Mangas.ts | 12 ++++++++----
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d6b20ecf..1407773e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -59,7 +59,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- (**Reader**) Fix infinite scrolling sometimes not opening previous/next chapter
- (**Reader**) Fix preserving scroll position with RTL reading direction and a language that is read RTL
- (**Browse**) Fix showing only nsfw sources in the browse source page when the "show nsfw" setting is disabled
-- (**Manga**) Fix mark as read/unread option not being disabled for manga without any chapters
+- (**Manga/Library**) Fix mark as read/unread option not being disabled for manga without any chapters
+- (**Manga/Library**) Fix delete/download option not being disabled for manga without any chapters
## [20260509.01] (r3147) - 2026-05-09
diff --git a/src/features/manga/components/MangaActionMenuItems.tsx b/src/features/manga/components/MangaActionMenuItems.tsx
index a4cd7bc5..78d9ba96 100644
--- a/src/features/manga/components/MangaActionMenuItems.tsx
+++ b/src/features/manga/components/MangaActionMenuItems.tsx
@@ -82,10 +82,10 @@ export const MangaActionMenuItems = ({
const shouldShowMenuItem = createShouldShowMenuItem(isSingleMode);
const isMenuItemDisabled = createIsMenuItemDisabled(isSingleMode);
- const isFullyDownloaded = !!manga && manga.downloadCount === manga.chapters.totalCount;
- const hasDownloadedChapters = !!manga?.downloadCount;
- const hasUnreadChapters = !!manga?.unreadCount;
- const hasReadChapters = !!manga && manga.unreadCount !== manga.chapters.totalCount;
+ const isPartiallyDownloaded = !!manga && Mangas.isPartiallyDownloaded(manga);
+ const hasDownloadedChapters = manga && Mangas.isPartiallyDownloaded(manga);
+ const hasUnreadChapters = manga && Mangas.isPartiallyRead(manga);
+ const hasReadChapters = !!manga && Mangas.isPartiallyRead(manga);
const handleSelect = () => {
handleSelection?.(manga.id, true);
@@ -121,7 +121,7 @@ export const MangaActionMenuItems = ({
{!!handleSelection && isSingleMode && (
)}
- {shouldShowMenuItem(!isFullyDownloaded) && (
+ {shouldShowMenuItem(isPartiallyDownloaded) && (
0 && downloadCount === 0;
}
static getNotDownloaded(mangas: Mangas[]): Mangas[] {
@@ -128,7 +128,7 @@ export class Mangas {
}
static isFullyDownloaded({ downloadCount, chapters: { totalCount } }: MangaDownloadInfo): boolean {
- return downloadCount === totalCount;
+ return totalCount > 0 && downloadCount === totalCount;
}
static getFullyDownloaded(mangas: Mangas[]): Mangas[] {
@@ -136,7 +136,11 @@ export class Mangas {
}
static isPartiallyDownloaded(manga: MangaDownloadInfo): boolean {
- return !Mangas.isNotDownloaded(manga) && !Mangas.isFullyDownloaded(manga);
+ const {
+ chapters: { totalCount },
+ } = manga;
+
+ return totalCount > 0 && !Mangas.isNotDownloaded(manga) && !Mangas.isFullyDownloaded(manga);
}
static getPartiallyDownloaded(mangas: Mangas[]): Mangas[] {