chore: Make categories backup independent

This commit is contained in:
Ahmad Ansori Palembani 2024-08-03 23:07:04 +07:00
parent 8c409ff306
commit 908b254072
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 6 additions and 7 deletions

View file

@ -49,12 +49,6 @@ data class BackupOptions(
getter = BackupOptions::libraryEntries,
setter = { options, enabled -> options.copy(libraryEntries = enabled) },
),
Entry(
label = MR.strings.categories,
getter = BackupOptions::categories,
setter = { options, enabled -> options.copy(categories = enabled) },
enabled = { it.libraryEntries },
),
Entry(
label = MR.strings.chapters,
getter = BackupOptions::chapters,
@ -85,6 +79,11 @@ data class BackupOptions(
setter = { options, enabled -> options.copy(readManga = enabled) },
enabled = { it.libraryEntries },
),
Entry(
label = MR.strings.categories,
getter = BackupOptions::categories,
setter = { options, enabled -> options.copy(categories = enabled) },
),
Entry(
label = MR.strings.app_settings,
getter = BackupOptions::appPrefs,

View file

@ -15,7 +15,7 @@ class CategoriesBackupCreator(
* @return list of [BackupCategory] to be backed up
*/
operator fun invoke(options: BackupOptions): List<BackupCategory> {
if (!options.libraryEntries) return emptyList()
if (!options.categories) return emptyList()
return db.getCategories()
.executeAsBlocking()