feat: 添加下载错误日志,从下载菜单浏览

pull/274/head 3.20.070519
gedoor 4 years ago
parent 606de68a69
commit cc97b48a69
  1. 4
      app/src/main/java/io/legado/app/service/DownloadService.kt
  2. 3
      app/src/main/java/io/legado/app/service/help/Download.kt

@ -184,9 +184,7 @@ class DownloadService : BaseService() {
scope = this,
context = searchPool
).onError {
it.localizedMessage?.let {
Download.addLog(it)
}
Download.addLog(it.localizedMessage)
}.onSuccess(IO) { content ->
downloadCount[book.bookUrl]?.increaseSuccess()
BookHelp.saveContent(book, bookChapter, content)

@ -9,7 +9,8 @@ object Download {
val logs = arrayListOf<String>()
fun addLog(log: String) {
fun addLog(log: String?) {
log ?: return
synchronized(this) {
if (logs.size > 30) {
logs.removeAt(0)

Loading…
Cancel
Save