From 803c825d91ae4f8ac2b104e33b3ee643a4add5f0 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Tue, 14 Oct 2025 13:46:16 +0300 Subject: [PATCH] Fix ProgressUpdateUseCase --- .../kotatsu/details/domain/ProgressUpdateUseCase.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/details/domain/ProgressUpdateUseCase.kt b/app/src/main/kotlin/org/koitharu/kotatsu/details/domain/ProgressUpdateUseCase.kt index 47d56695e..3c3e5297b 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/details/domain/ProgressUpdateUseCase.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/details/domain/ProgressUpdateUseCase.kt @@ -34,12 +34,17 @@ class ProgressUpdateUseCase @Inject constructor( } val chapter = details.findChapterById(history.chapterId) ?: return PROGRESS_NONE val chapters = details.getChapters(chapter.branch) + val chapterRepo = if (repo.source == chapter.source) { + repo + } else { + mangaRepositoryFactory.create(chapter.source) + } val chaptersCount = chapters.size if (chaptersCount == 0) { return PROGRESS_NONE } val chapterIndex = chapters.indexOfFirst { x -> x.id == history.chapterId } - val pagesCount = repo.getPages(chapter).size + val pagesCount = chapterRepo.getPages(chapter).size if (pagesCount == 0) { return PROGRESS_NONE }