|
|
@ -29,6 +29,8 @@ object AppWebDav { |
|
|
|
private val bookProgressUrl = "${rootWebDavUrl}bookProgress/" |
|
|
|
private val bookProgressUrl = "${rootWebDavUrl}bookProgress/" |
|
|
|
private val zipFilePath = "${appCtx.externalFiles.absolutePath}${File.separator}backup.zip" |
|
|
|
private val zipFilePath = "${appCtx.externalFiles.absolutePath}${File.separator}backup.zip" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val syncBookProgress get() = appCtx.getPrefBoolean(PreferKey.syncBookProgress, true) |
|
|
|
|
|
|
|
|
|
|
|
var isOk = false |
|
|
|
var isOk = false |
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
init { |
|
|
@ -167,7 +169,7 @@ object AppWebDav { |
|
|
|
|
|
|
|
|
|
|
|
fun uploadBookProgress(book: Book) { |
|
|
|
fun uploadBookProgress(book: Book) { |
|
|
|
if (!isOk) return |
|
|
|
if (!isOk) return |
|
|
|
if (!AppConfig.syncBookProgress) return |
|
|
|
if (!syncBookProgress) return |
|
|
|
if (!NetworkUtils.isAvailable()) return |
|
|
|
if (!NetworkUtils.isAvailable()) return |
|
|
|
Coroutine.async { |
|
|
|
Coroutine.async { |
|
|
|
val bookProgress = BookProgress(book) |
|
|
|
val bookProgress = BookProgress(book) |
|
|
|