Add ability to select what to sync

This commit is contained in:
Bartu Özen
2025-12-11 23:21:43 +03:00
parent 56de3cc055
commit 878ee960f3
2 changed files with 40 additions and 5 deletions

View File

@@ -1037,6 +1037,40 @@ class ServerConfig(
privacySafe = false,
)
val syncDataManga: MutableStateFlow<Boolean> by BooleanSetting(
protoNumber = 89,
defaultValue = true,
group = SettingGroup.SYNCYOMI,
privacySafe = true,
)
val syncDataChapters: MutableStateFlow<Boolean> by BooleanSetting(
protoNumber = 90,
defaultValue = true,
group = SettingGroup.SYNCYOMI,
privacySafe = true,
)
val syncDataTracking: MutableStateFlow<Boolean> by BooleanSetting(
protoNumber = 91,
defaultValue = true,
group = SettingGroup.SYNCYOMI,
privacySafe = true,
)
val syncDataHistory: MutableStateFlow<Boolean> by BooleanSetting(
protoNumber = 92,
defaultValue = true,
group = SettingGroup.SYNCYOMI,
privacySafe = true,
)
val syncDataCategories: MutableStateFlow<Boolean> by BooleanSetting(
protoNumber = 93,
defaultValue = true,
group = SettingGroup.SYNCYOMI,
privacySafe = true,
)
/** ****************************************************************** **/
/** **/

View File

@@ -24,6 +24,7 @@ import suwayomi.tachidesk.manga.model.table.ChapterTable
import suwayomi.tachidesk.manga.model.table.MangaStatus
import suwayomi.tachidesk.manga.model.table.MangaTable
import suwayomi.tachidesk.manga.model.table.toDataClass
import suwayomi.tachidesk.server.serverConfig
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.util.Date
@@ -51,11 +52,11 @@ object SyncManager {
val databaseManga = getAllMangaThatNeedsSync()
val backupFlags = BackupFlags(
includeManga = true,
includeCategories = true,
includeChapters = true,
includeTracking = true,
includeHistory = true,
includeManga = serverConfig.syncDataManga.value,
includeCategories = serverConfig.syncDataCategories.value,
includeChapters = serverConfig.syncDataChapters.value,
includeTracking = serverConfig.syncDataTracking.value,
includeHistory = serverConfig.syncDataHistory.value,
includeClientData = false,
includeServerSettings = false,
)