Sort and remove duplicates in genres (#6021)

* Sort and remove duplicates in genres

Co-authored-by: ivaniskandar <12537387+ivaniskandar@users.noreply.github.com>

* Remove Sort and filter out blank genre

Co-authored-by: ivaniskandar <12537387+ivaniskandar@users.noreply.github.com>
This commit is contained in:
FourTOne5 2021-10-03 22:19:37 +06:00 committed by GitHub
parent b0f87fdd21
commit 7940117577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {