|
@@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.data.database.DatabaseHelper
|
|
|
import eu.kanade.tachiyomi.data.database.models.Chapter
|
|
|
import eu.kanade.tachiyomi.data.database.models.History
|
|
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
|
|
+import eu.kanade.tachiyomi.source.SourceManager
|
|
|
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
|
|
|
import rx.Observable
|
|
|
import rx.android.schedulers.AndroidSchedulers
|
|
@@ -23,6 +24,8 @@ class RecentlyReadPresenter : BasePresenter<RecentlyReadController>() {
|
|
|
*/
|
|
|
val db: DatabaseHelper by injectLazy()
|
|
|
|
|
|
+ private val sourceManager: SourceManager by injectLazy()
|
|
|
+
|
|
|
override fun onCreate(savedState: Bundle?) {
|
|
|
super.onCreate(savedState)
|
|
|
|
|
@@ -42,7 +45,10 @@ class RecentlyReadPresenter : BasePresenter<RecentlyReadController>() {
|
|
|
cal.add(Calendar.MONTH, -1)
|
|
|
|
|
|
return db.getRecentManga(cal.time).asRxObservable()
|
|
|
- .map { it.map(::RecentlyReadItem) }
|
|
|
+ .map { recents ->
|
|
|
+ recents.filter { sourceManager.get(it.manga.source) != null }
|
|
|
+ .map(::RecentlyReadItem)
|
|
|
+ }
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
}
|
|
|
|