mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Minor cleanup
This commit is contained in:
parent
4338c41112
commit
f7e70d25ea
2 changed files with 5 additions and 3 deletions
|
@ -342,7 +342,7 @@ class LibraryController(
|
||||||
searchItem.fixExpand(onExpand = { invalidateMenuOnExpand() })
|
searchItem.fixExpand(onExpand = { invalidateMenuOnExpand() })
|
||||||
}
|
}
|
||||||
|
|
||||||
fun search(query:String) {
|
fun search(query: String) {
|
||||||
this.query = query
|
this.query = query
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,9 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference
|
||||||
if (constraint.contains(",")) {
|
if (constraint.contains(",")) {
|
||||||
val genres = manga.genre?.split(", ")
|
val genres = manga.genre?.split(", ")
|
||||||
constraint.split(",").all { containsGenre(it.trim(), genres) }
|
constraint.split(",").all { containsGenre(it.trim(), genres) }
|
||||||
|
} else {
|
||||||
|
containsGenre(constraint, manga.genre?.split(", "))
|
||||||
}
|
}
|
||||||
else containsGenre(constraint, manga.genre?.split(", "))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun containsGenre(tag: String, genres: List<String>?): Boolean {
|
private fun containsGenre(tag: String, genres: List<String>?): Boolean {
|
||||||
|
@ -75,7 +76,8 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference
|
||||||
} == null
|
} == null
|
||||||
else
|
else
|
||||||
genres?.find {
|
genres?.find {
|
||||||
it.trim().toLowerCase() == tag.toLowerCase() } != null
|
it.trim().toLowerCase() == tag.toLowerCase()
|
||||||
|
} != null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
|
Loading…
Reference in a new issue