瀏覽代碼

Sort and remove duplicates in genres (#6021)

* Sort and remove duplicates in genres

Co-authored-by: ivaniskandar <[email protected]>

* Remove Sort and filter out blank genre

Co-authored-by: ivaniskandar <[email protected]>
FourTOne5 3 年之前
父節點
當前提交
7940117577
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt

+ 3 - 1
app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt

@@ -36,7 +36,9 @@ interface Manga : SManga {
     }
 
     fun getGenres(): List<String>? {
-        return genre?.split(", ")?.map { it.trim() }
+        if (genre.isNullOrBlank()) return null
+        return genre?.split(", ")?.map { it.trim() } ?.filterNot { it.isBlank() } ?.distinct()
+        
     }
 
     private fun setChapterFlags(flag: Int, mask: Int) {