New categories now default to title sorting in D&D/single list mode

This commit is contained in:
Jay 2020-02-23 21:32:56 -08:00
parent 4aee7752c4
commit 6cccdf4459
3 changed files with 12 additions and 6 deletions

View File

@ -60,12 +60,17 @@ class CategoryGetResolver : DefaultGetResolver<Category>() {
flags = cursor.getInt(cursor.getColumnIndex(COL_FLAGS))
val orderString = cursor.getString(cursor.getColumnIndex(COL_MANGA_ORDER))
if (orderString?.firstOrNull()?.isLetter() == true) {
mangaSort = orderString.first()
mangaOrder = emptyList()
when {
orderString.isNullOrBlank() -> {
mangaSort = 'a'
mangaOrder = emptyList()
}
orderString.firstOrNull()?.isLetter() == true -> {
mangaSort = orderString.first()
mangaOrder = emptyList()
}
else -> mangaOrder = orderString.split("/")?.mapNotNull { it.toLongOrNull() }
}
else
mangaOrder = orderString?.split("/")?.mapNotNull { it.toLongOrNull() } ?: emptyList()
}
}

View File

@ -72,6 +72,7 @@ class CategoryPresenter(
// Insert into database.
cat.mangaSort = 'a'
db.insertCategory(cat).executeAsBlocking()
val cats = db.getCategories().executeAsBlocking()
val newCat = cats.find { it.name == name } ?: return false

View File

@ -50,7 +50,7 @@ class SettingsGeneralController : SettingsController() {
R.string.system_theme, R.string.sysyem_white_theme, R.string.system_amoled_theme, R.string
.system_darkblue_theme)
entryValues = listOf(1, 8, 2, 3, 4, 5, 9, 6, 7)
defaultValue = 8
defaultValue = 9
onChange {
activity?.recreate()