From d9969cea8afdce26eb8c7f57f214cd04cfb8c836 Mon Sep 17 00:00:00 2001 From: Two-Ai <81279822+Two-Ai@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:46:31 -0500 Subject: [PATCH] Fix ID type mismatch in MigrateSearchScreenModel (#9090) `it.id` is the source ID of the source being sorted. `state.value.manga!!.id` is the manga ID of the selected manga. `state.value.manga!!.source` is the source ID of the selected manga. (cherry picked from commit dc2eaf07882ce1e7acaea9de7eb26de331ef6c77) --- .../ui/browse/migration/search/MigrateSearchScreenModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreenModel.kt index 52da77887..6714f308d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreenModel.kt @@ -49,7 +49,7 @@ class MigrateSearchScreenModel( .filter { it.lang in enabledLanguages } .filterNot { "${it.id}" in disabledSources } .sortedWith(compareBy({ "${it.id}" !in pinnedSources }, { "${it.name.lowercase()} (${it.lang})" })) - .sortedByDescending { it.id == state.value.manga!!.id } + .sortedByDescending { it.id == state.value.manga!!.source } } override fun updateSearchQuery(query: String?) {