mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-13 12:38:58 +01:00
Implement lenient sync
This commit is contained in:
@@ -125,6 +125,8 @@ object PreferenceKeys {
|
||||
|
||||
const val eh_readOnlySync = "eh_sync_read_only"
|
||||
|
||||
const val eh_lenientSync = "eh_lenient_sync"
|
||||
|
||||
const val eh_useOrigImages = "eh_useOrigImages"
|
||||
|
||||
const val eh_ehSettingsProfile = "eh_ehSettingsProfile"
|
||||
|
||||
@@ -217,6 +217,8 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun eh_readOnlySync() = rxPrefs.getBoolean(Keys.eh_readOnlySync, false)
|
||||
|
||||
fun eh_lenientSync() = rxPrefs.getBoolean(Keys.eh_lenientSync, false)
|
||||
|
||||
fun eh_showSettingsUploadWarning() = rxPrefs.getBoolean(Keys.eh_showSettingsUploadWarning, true)
|
||||
// <-- EH
|
||||
}
|
||||
|
||||
@@ -619,6 +619,20 @@ class LibraryController(
|
||||
}
|
||||
?.show()
|
||||
}
|
||||
is FavoritesSyncStatus.CompleteWithErrors -> {
|
||||
releaseSyncLocks()
|
||||
|
||||
favSyncDialog?.dismiss()
|
||||
favSyncDialog = buildDialog()
|
||||
?.title("Favorites sync complete with errors")
|
||||
?.content("Errors occurred during the sync process that were ignored:\n${status.message}")
|
||||
?.cancelable(false)
|
||||
?.positiveText("Ok")
|
||||
?.onPositive { _, _ ->
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle())
|
||||
}
|
||||
?.show()
|
||||
}
|
||||
is FavoritesSyncStatus.Processing,
|
||||
is FavoritesSyncStatus.Initializing -> {
|
||||
takeSyncLocks()
|
||||
|
||||
@@ -135,6 +135,7 @@ class SettingsEhController : SettingsController() {
|
||||
title = "Disable favorites uploading"
|
||||
summary = "Favorites are only downloaded from ExHentai. Any changes to favorites in the app will not be uploaded. Prevents accidental loss of favorites on ExHentai. Note that removals will still be downloaded (if you remove a favorites on ExHentai, it will be removed in the app as well)."
|
||||
key = PreferenceKeys.eh_readOnlySync
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
preference {
|
||||
@@ -148,9 +149,16 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
}
|
||||
|
||||
switchPreference {
|
||||
title = "Ignore sync errors when possible"
|
||||
summary = "Do not abort immediately when encountering errors during the sync process. Errors will still be displayed when the sync is complete. Can cause loss of favorites in some cases. Useful when syncing large libraries."
|
||||
key = PreferenceKeys.eh_lenientSync
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
preference {
|
||||
title = "Force sync state reset"
|
||||
summary = "Performs a full resynchronization on the next sync. Removals will not be synced. All favorites in the app will be re-uploaded to ExHentai and all favorites on ExHentai will be redownloaded into the app. Useful for repairing sync after sync has been interrupted."
|
||||
summary = "Performs a full resynchronization on the next sync. Removals will not be synced. All favorites in the app will be re-uploaded to ExHentai and all favorites on ExHentai will be re-downloaded into the app. Useful for repairing sync after sync has been interrupted."
|
||||
|
||||
onClick {
|
||||
activity?.let {
|
||||
|
||||
Reference in New Issue
Block a user