mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-10 00:19:21 +01:00
Fixed all category sorting for D&D
This commit is contained in:
parent
cc81b37f03
commit
f3b96c430e
@ -209,6 +209,7 @@ class LibraryPresenter(
|
|||||||
}
|
}
|
||||||
val catListing by lazy {
|
val catListing by lazy {
|
||||||
val default = Category.createDefault(context)
|
val default = Category.createDefault(context)
|
||||||
|
default.order = -1
|
||||||
val defOrder = preferences.defaultMangaOrder().getOrDefault()
|
val defOrder = preferences.defaultMangaOrder().getOrDefault()
|
||||||
if (defOrder.firstOrNull()?.isLetter() == true) default.mangaSort = defOrder.first()
|
if (defOrder.firstOrNull()?.isLetter() == true) default.mangaSort = defOrder.first()
|
||||||
else default.mangaOrder = defOrder.split("/").mapNotNull { it.toLongOrNull() }
|
else default.mangaOrder = defOrder.split("/").mapNotNull { it.toLongOrNull() }
|
||||||
@ -267,9 +268,9 @@ class LibraryPresenter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val category = catListing.find { it.id == i1.manga.category }
|
val category = catListing.find { it.id == i1.manga.category }?.order ?: -1
|
||||||
val category2 = catListing.find { it.id == i2.manga.category }
|
val category2 = catListing.find { it.id == i2.manga.category }?.order ?: -1
|
||||||
category?.order?.compareTo(category2?.order ?: 0) ?: 0
|
category.compareTo(category2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> 0
|
else -> 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user