Add setting to apply chapter list filters in reader

This commit is contained in:
schroda
2025-07-01 00:37:29 +02:00
parent 21671f3d79
commit 51975ea3cd
13 changed files with 119 additions and 62 deletions

View File

@@ -475,32 +475,22 @@ export class ReaderControls {
endReached?: boolean,
) => void {
const { currentPageIndex, setCurrentPageIndex } = userReaderStatePagesContext();
const {
chapterForDuplicatesHandling,
currentChapter,
previousChapter,
nextChapter,
mangaChapters,
visibleChapters,
setReaderStateChapters,
} = useReaderStateChaptersContext();
const { currentChapter, chapters, previousChapter, nextChapter, visibleChapters, setReaderStateChapters } =
useReaderStateChaptersContext();
const updateChapter = ReaderService.useUpdateChapter();
const { shouldSkipDupChapters } = ReaderService.useSettings();
const {
settings: { downloadAheadLimit },
} = useMetadataServerSettings();
const nextChapters = useMemo(() => {
if (!chapterForDuplicatesHandling || !currentChapter) {
if (!currentChapter) {
return [];
}
return Chapters.getNextChapters(currentChapter, mangaChapters, {
return Chapters.getNextChapters(currentChapter, chapters, {
offset: DirectionOffset.NEXT,
skipDupe: shouldSkipDupChapters,
skipDupeChapter: chapterForDuplicatesHandling,
});
}, [chapterForDuplicatesHandling?.id, currentChapter?.id, mangaChapters, shouldSkipDupChapters]);
}, [currentChapter?.id, chapters]);
return useCallback(
(pageIndex, debounceChapterUpdate = true, endReached = false) => {