From f7e70d25ea2b9b845ce777f18f7a2af67d456a54 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 16 Jan 2020 21:47:46 -0500 Subject: [PATCH] Minor cleanup --- .../eu/kanade/tachiyomi/ui/library/LibraryController.kt | 2 +- .../main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 5b4ecd722b..e7aa967f4f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -342,7 +342,7 @@ class LibraryController( searchItem.fixExpand(onExpand = { invalidateMenuOnExpand() }) } - fun search(query:String) { + fun search(query: String) { this.query = query } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt index f174a4154f..392b2e9786 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt @@ -64,8 +64,9 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference if (constraint.contains(",")) { val genres = manga.genre?.split(", ") 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?): Boolean { @@ -75,7 +76,8 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference } == null else genres?.find { - it.trim().toLowerCase() == tag.toLowerCase() } != null + it.trim().toLowerCase() == tag.toLowerCase() + } != null } override fun equals(other: Any?): Boolean {