diff --git a/app/src/main/java/io/legado/app/data/entities/BookProgress.kt b/app/src/main/java/io/legado/app/data/entities/BookProgress.kt index e5d1e5c35..d5fd70d10 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookProgress.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookProgress.kt @@ -7,4 +7,15 @@ data class BookProgress( val durChapterPos: Int, val durChapterTime: Long, val durChapterTitle: String? -) \ No newline at end of file +) { + + constructor(book: Book) : this( + name = book.name, + author = book.author, + durChapterIndex = book.durChapterIndex, + durChapterPos = book.durChapterPos, + durChapterTime = book.durChapterTime, + durChapterTitle = book.durChapterTitle + ) + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/storage/BookWebDav.kt b/app/src/main/java/io/legado/app/help/storage/BookWebDav.kt index a194cf4e7..f98b1bd68 100644 --- a/app/src/main/java/io/legado/app/help/storage/BookWebDav.kt +++ b/app/src/main/java/io/legado/app/help/storage/BookWebDav.kt @@ -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()) { diff --git a/build.gradle b/build.gradle index 537e02b97..844e4e6b6 100644 --- a/build.gradle +++ b/build.gradle @@ -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' }