From f3b96c430e72708fb9a7e38ab77970674c16e442 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 2 Feb 2020 02:24:02 -0800 Subject: [PATCH] Fixed all category sorting for D&D --- .../eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 764f550775..7d4c97883a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -209,6 +209,7 @@ class LibraryPresenter( } val catListing by lazy { val default = Category.createDefault(context) + default.order = -1 val defOrder = preferences.defaultMangaOrder().getOrDefault() if (defOrder.firstOrNull()?.isLetter() == true) default.mangaSort = defOrder.first() else default.mangaOrder = defOrder.split("/").mapNotNull { it.toLongOrNull() } @@ -267,9 +268,9 @@ class LibraryPresenter( } } else { - val category = catListing.find { it.id == i1.manga.category } - val category2 = catListing.find { it.id == i2.manga.category } - category?.order?.compareTo(category2?.order ?: 0) ?: 0 + val category = catListing.find { it.id == i1.manga.category }?.order ?: -1 + val category2 = catListing.find { it.id == i2.manga.category }?.order ?: -1 + category.compareTo(category2) } } else -> 0