mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-13 04:28:55 +01:00
Filter out non-downloaded chapters in reader when Downloaded Only is enabled (#9568)
* FIxed Issue #5463 - DownloadedOnly Bug * Changes according to Feedback * Changes according to Feedback --------- Co-authored-by: AlphiGhost <71730726+AlphiGhost@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package eu.kanade.tachiyomi.util.chapter
|
||||
|
||||
import eu.kanade.tachiyomi.data.download.DownloadCache
|
||||
import tachiyomi.domain.chapter.model.Chapter
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
/**
|
||||
* Returns a copy of the list with not downloaded chapters removed
|
||||
*/
|
||||
fun List<Chapter>.filterDownloaded(manga: Manga): List<Chapter> {
|
||||
val downloadCache: DownloadCache = Injekt.get()
|
||||
|
||||
return filter { downloadCache.isChapterDownloaded(it.name, it.scanlator, manga.title, manga.source, false) }
|
||||
}
|
||||
Reference in New Issue
Block a user