fix: enqueue duplicate chapters for deletion after marking as read#3030
Open
leodyversemilla07 wants to merge 1 commit intomihonapp:mainfrom
Open
fix: enqueue duplicate chapters for deletion after marking as read#3030leodyversemilla07 wants to merge 1 commit intomihonapp:mainfrom
leodyversemilla07 wants to merge 1 commit intomihonapp:mainfrom
Conversation
When a chapter is completed and duplicate chapters are auto-marked as read (via 'Mark duplicate chapters as read' setting), the downloaded duplicate chapters were never enqueued for deletion. Root cause: the duplicate-marking code converted Chapter objects into ChapterUpdate objects immediately (only id + read flag), discarding the full chapter data needed to call enqueueChaptersToDelete(). The delete call was also simply missing. Fix: retain full Chapter objects when collecting duplicates so they can be passed to downloadManager.enqueueChaptersToDelete(), and add the missing deletion call — guarded by the existing 'delete after read' preference (removeAfterReadSlots != -1). Fixes mihonapp#2454
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2454
Root Cause
In
updateChapterProgressOnComplete(), when duplicate chapters are auto-marked as read (via the 'Mark duplicate chapters as read' setting),enqueueChaptersToDelete()was never called for them.The code used
mapNotNull { ChapterUpdate(...) }which immediately converted fullChapterobjects into lightweightChapterUpdateobjects (onlyid+readflag). This discarded the full chapter data required bydownloadManager.enqueueChaptersToDelete(), and the delete call was simply missing from this code path.Change
File:
app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.ktReplaced
mapNotNull { ChapterUpdate }withfilter { Chapter }to retain fullChapterobjects, then:.map { ChapterUpdate(...) }— identical behavior as beforedownloadManager.enqueueChaptersToDelete(), using the sameremoveAfterReadSlots != -1guard that protects the existingdeleteChapterIfNeeded()call