From 6394388714434742749b44deb77b6ec4e78e4561 Mon Sep 17 00:00:00 2001 From: inorichi Date: Wed, 22 Nov 2017 21:41:57 +0100 Subject: [PATCH] Fix #764. Update Kissmanga genres --- .../kanade/tachiyomi/source/online/english/Kissmanga.kt | 3 +++ .../ui/recent_updates/RecentChaptersPresenter.kt | 5 +++-- .../tachiyomi/ui/recently_read/RecentlyReadPresenter.kt | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Kissmanga.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Kissmanga.kt index b311a942e0..567174891d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Kissmanga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Kissmanga.kt @@ -226,6 +226,7 @@ class Kissmanga : ParsedHttpSource() { Genre("Mystery"), Genre("One shot"), Genre("Psychological"), + Genre("Reincarnation"), Genre("Romance"), Genre("School Life"), Genre("Sci-fi"), @@ -239,7 +240,9 @@ class Kissmanga : ParsedHttpSource() { Genre("Smut"), Genre("Sports"), Genre("Supernatural"), + Genre("Time Travel"), Genre("Tragedy"), + Genre("Transported"), Genre("Webtoon"), Genre("Yaoi"), Genre("Yuri") diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt index b9496a72bd..3564a8ba11 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt @@ -5,7 +5,6 @@ import com.hippo.unifile.UniFile import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.models.MangaChapter import eu.kanade.tachiyomi.data.download.DownloadManager -import eu.kanade.tachiyomi.data.download.DownloadService import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.source.SourceManager @@ -58,7 +57,9 @@ class RecentChaptersPresenter( // Convert to a list of recent chapters. .map { mangaChapters -> val map = TreeMap> { d1, d2 -> d2.compareTo(d1) } - val byDay = mangaChapters.groupByTo(map, { getMapKey(it.chapter.date_fetch) }) + val byDay = mangaChapters + .filter { sourceManager.get(it.manga.source) != null } + .groupByTo(map, { getMapKey(it.chapter.date_fetch) }) byDay.flatMap { val dateItem = DateItem(it.key) it.value.map { RecentChapterItem(it.chapter, it.manga, dateItem) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt index 28abe7881d..934869103d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt @@ -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() { */ 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() { 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()) }