pull/1259/head
gedoor 3 years ago
parent fd8ac3ed1d
commit 1c4dcf7532
  1. 13
      app/src/main/java/io/legado/app/data/entities/BookProgress.kt
  2. 9
      app/src/main/java/io/legado/app/help/storage/BookWebDav.kt
  3. 2
      build.gradle

@ -7,4 +7,15 @@ data class BookProgress(
val durChapterPos: Int, val durChapterPos: Int,
val durChapterTime: Long, val durChapterTime: Long,
val durChapterTitle: String? 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
)
}

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

@ -10,7 +10,7 @@ buildscript {
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
} }
dependencies { 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 "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'de.timfreiheit.resourceplaceholders:placeholders:0.4' classpath 'de.timfreiheit.resourceplaceholders:placeholders:0.4'
} }

Loading…
Cancel
Save