This commit is contained in:
gedoor 2021-08-19 18:29:32 +08:00
parent fd8ac3ed1d
commit 1c4dcf7532
3 changed files with 14 additions and 10 deletions

View File

@ -7,4 +7,15 @@ data class BookProgress(
val durChapterPos: Int,
val durChapterTime: Long,
val durChapterTitle: String?
)
) {
constructor(book: Book) : this(
name = book.name,
author = book.author,
durChapterIndex = book.durChapterIndex,
durChapterPos = book.durChapterPos,
durChapterTime = book.durChapterTime,
durChapterTitle = book.durChapterTitle
)
}

View File

@ -141,14 +141,7 @@ object BookWebDav {
fun uploadBookProgress(book: Book) {
if (!NetworkUtils.isAvailable()) return
Coroutine.async {
val bookProgress = BookProgress(
name = book.name,
author = book.author,
durChapterIndex = book.durChapterIndex,
durChapterPos = book.durChapterPos,
durChapterTime = book.durChapterTime,
durChapterTitle = book.durChapterTitle
)
val bookProgress = BookProgress(book)
val json = GSON.toJson(bookProgress)
val url = getProgressUrl(book)
if (initWebDav()) {

View File

@ -10,7 +10,7 @@ buildscript {
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath 'com.android.tools.build:gradle:7.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'de.timfreiheit.resourceplaceholders:placeholders:0.4'
}