mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Consider local manga as downloaded when filtering in reader
Fixes #9801
This commit is contained in:
parent
6259bbaa5e
commit
39c6bcccd8
1 changed files with 4 additions and 1 deletions
|
@ -3,13 +3,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 tachiyomi.source.local.isLocal
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
/**
|
||||
* Returns a copy of the list with not downloaded chapters removed
|
||||
* Returns a copy of the list with not downloaded chapters removed.
|
||||
*/
|
||||
fun List<Chapter>.filterDownloaded(manga: Manga): List<Chapter> {
|
||||
if (manga.isLocal()) return this
|
||||
|
||||
val downloadCache: DownloadCache = Injekt.get()
|
||||
|
||||
return filter { downloadCache.isChapterDownloaded(it.name, it.scanlator, manga.title, manga.source, false) }
|
||||
|
|
Loading…
Reference in a new issue