|
|
@ -30,16 +30,18 @@ object SyncBookProgress { |
|
|
|
|
|
|
|
|
|
|
|
fun downloadBookProgress() { |
|
|
|
fun downloadBookProgress() { |
|
|
|
Coroutine.async { |
|
|
|
Coroutine.async { |
|
|
|
WebDav(webDavUrl).downloadTo(file.absolutePath, true) |
|
|
|
if (WebDavHelp.initWebDav()) { |
|
|
|
if (file.exists()) { |
|
|
|
WebDav(webDavUrl).downloadTo(file.absolutePath, true) |
|
|
|
val json = file.readText() |
|
|
|
if (file.exists()) { |
|
|
|
GSON.fromJsonArray<BookProgress>(json)?.forEach { |
|
|
|
val json = file.readText() |
|
|
|
App.db.bookDao().upBookProgress( |
|
|
|
GSON.fromJsonArray<BookProgress>(json)?.forEach { |
|
|
|
it.bookUrl, |
|
|
|
App.db.bookDao().upBookProgress( |
|
|
|
it.durChapterIndex, |
|
|
|
it.bookUrl, |
|
|
|
it.durChapterPos, |
|
|
|
it.durChapterIndex, |
|
|
|
it.durChapterTime |
|
|
|
it.durChapterPos, |
|
|
|
) |
|
|
|
it.durChapterTime |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|