Add option for bookmarked chapters to download dropdown (#2891)

(cherry picked from commit 3c6f0f1697ccab055ee7af47da84b2161d406f0c)

# Conflicts:
#	CHANGELOG.md
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt
This commit is contained in:
NarwhalHorns
2026-02-21 10:14:55 +00:00
committed by Jobobby04
parent 3cfc53bf11
commit 185cd923c0
7 changed files with 109 additions and 10 deletions
@@ -0,0 +1,33 @@
package tachiyomi.domain.chapter.interactor
import exh.source.MERGED_SOURCE_ID
import logcat.LogPriority
import tachiyomi.core.common.util.system.logcat
import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.chapter.repository.ChapterRepository
import tachiyomi.domain.manga.interactor.GetManga
class GetBookmarkedChaptersByMangaId(
private val chapterRepository: ChapterRepository,
// SY -->
private val getManga: GetManga,
private val getMergedChaptersByMangaId: GetMergedChaptersByMangaId,
// SY <--
) {
suspend fun await(mangaId: Long): List<Chapter> {
return try {
// SY -->
val manga = getManga.await(mangaId) ?: return emptyList()
if (manga.source == MERGED_SOURCE_ID) {
return getMergedChaptersByMangaId.await(mangaId, applyScanlatorFilter = true)
.filter { it.bookmark }
}
// SY <--
chapterRepository.getBookmarkedChaptersByMangaId(mangaId)
} catch (e: Exception) {
logcat(LogPriority.ERROR, e)
emptyList()
}
}
}