Browse Source

Fix #764. Update Kissmanga genres

inorichi 7 years ago
parent
commit
6394388714

+ 3 - 0
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")

+ 3 - 2
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<Date, MutableList<MangaChapter>> { 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) }

+ 7 - 1
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<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())
     }