fix: minor changes

This commit is contained in:
Yaoliang
2024-07-10 14:29:30 +08:00
parent b8aa694736
commit 11a0e90462
4 changed files with 4 additions and 10 deletions
@@ -517,4 +517,4 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
}
}
}
@@ -330,8 +330,7 @@ abstract class BaseReadBookActivity :
{ _, yy, mm, dayOfMonth ->
// 使用Java 8的日期和时间API来格式化日期
val date = LocalDate.of(yy, mm + 1, dayOfMonth) // Java 8的LocalDate,月份从1开始
val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
val formattedDate = date.format(formatter)
val formattedDate = date.format(dateFormatter)
startDate.setText(formattedDate)
}, localStartDate.year, localStartDate.monthValue - 1, localStartDate.dayOfMonth
)
@@ -229,12 +229,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
AppLog.put("拉取阅读进度失败《${book.name}\n${it.localizedMessage}", it)
}.onSuccess { progress ->
if (progress.durChapterIndex < book.durChapterIndex ||
progress.durChapterIndex >= book.simulatedTotalChapterNum() ||
(progress.durChapterIndex == book.durChapterIndex
&& progress.durChapterPos < book.durChapterPos)
) {
alertSync?.invoke(progress)
} else {
} else if (progress.durChapterIndex < book.simulatedTotalChapterNum()) {
ReadBook.setProgress(progress)
AppLog.put("自动同步阅读进度成功《${book.name}${progress.durChapterTitle}")
}
@@ -545,4 +544,4 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
}
}
}
}