mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 00:39:14 +01:00
Remove redundant DB call in library settings (closes #3128)
This commit is contained in:
parent
a20874f6a1
commit
521ebf0678
@ -212,6 +212,10 @@ class BackupRestoreService : Service() {
|
|||||||
|
|
||||||
// Restore individual manga
|
// Restore individual manga
|
||||||
mangasJson.forEach {
|
mangasJson.forEach {
|
||||||
|
if (job?.isActive != true) {
|
||||||
|
throw Exception(getString(R.string.restoring_backup_canceled))
|
||||||
|
}
|
||||||
|
|
||||||
restoreManga(it.asJsonObject)
|
restoreManga(it.asJsonObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,10 +256,6 @@ class BackupRestoreService : Service() {
|
|||||||
?: JsonArray()
|
?: JsonArray()
|
||||||
)
|
)
|
||||||
|
|
||||||
if (job?.isActive != true) {
|
|
||||||
throw Exception(getString(R.string.restoring_backup_canceled))
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
restoreMangaData(manga, chapters, categories, history, tracks)
|
restoreMangaData(manga, chapters, categories, history, tracks)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@ -172,7 +172,7 @@ class SettingsLibraryController : SettingsController() {
|
|||||||
preference {
|
preference {
|
||||||
titleRes = R.string.action_edit_categories
|
titleRes = R.string.action_edit_categories
|
||||||
|
|
||||||
val catCount = db.getCategories().executeAsBlocking().size
|
val catCount = dbCategories.size
|
||||||
summary = context.resources.getQuantityString(R.plurals.num_categories, catCount, catCount)
|
summary = context.resources.getQuantityString(R.plurals.num_categories, catCount, catCount)
|
||||||
|
|
||||||
onClick {
|
onClick {
|
||||||
|
Loading…
Reference in New Issue
Block a user