|
@@ -34,6 +34,7 @@ import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
|
|
|
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
|
|
|
import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
|
|
|
import eu.kanade.tachiyomi.ui.reader.viewer.Viewer
|
|
|
+import eu.kanade.tachiyomi.util.chapter.filterDownloaded
|
|
|
import eu.kanade.tachiyomi.util.chapter.removeDuplicates
|
|
|
import eu.kanade.tachiyomi.util.editCover
|
|
|
import eu.kanade.tachiyomi.util.lang.byteSize
|
|
@@ -91,6 +92,7 @@ class ReaderViewModel(
|
|
|
private val downloadProvider: DownloadProvider = Injekt.get(),
|
|
|
private val imageSaver: ImageSaver = Injekt.get(),
|
|
|
preferences: BasePreferences = Injekt.get(),
|
|
|
+ private val basePreferences: BasePreferences = Injekt.get(),
|
|
|
private val downloadPreferences: DownloadPreferences = Injekt.get(),
|
|
|
private val readerPreferences: ReaderPreferences = Injekt.get(),
|
|
|
private val trackPreferences: TrackPreferences = Injekt.get(),
|
|
@@ -184,6 +186,13 @@ class ReaderViewModel(
|
|
|
this
|
|
|
}
|
|
|
}
|
|
|
+ .run {
|
|
|
+ if (basePreferences.downloadedOnly().get()) {
|
|
|
+ filterDownloaded(manga)
|
|
|
+ } else {
|
|
|
+ this
|
|
|
+ }
|
|
|
+ }
|
|
|
.map { it.toDbChapter() }
|
|
|
.map(::ReaderChapter)
|
|
|
}
|