mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
64dc055560
commit
8dfc8904b1
@ -389,9 +389,7 @@ class AudioPlayService : BaseService(),
|
|||||||
WebBook.getContent(this@AudioPlayService, bookSource, book, chapter)
|
WebBook.getContent(this@AudioPlayService, bookSource, book, chapter)
|
||||||
.onSuccess { content ->
|
.onSuccess { content ->
|
||||||
if (content.isEmpty()) {
|
if (content.isEmpty()) {
|
||||||
withContext(Main) {
|
|
||||||
toastOnUi("未获取到资源链接")
|
toastOnUi("未获取到资源链接")
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
contentLoadFinish(chapter, content)
|
contentLoadFinish(chapter, content)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import android.content.Intent
|
|||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.util.Base64
|
import android.util.Base64
|
||||||
import android.webkit.URLUtil
|
import android.webkit.URLUtil
|
||||||
import androidx.documentfile.provider.DocumentFile
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import io.legado.app.base.BaseViewModel
|
import io.legado.app.base.BaseViewModel
|
||||||
@ -20,14 +19,10 @@ import io.legado.app.help.http.newCallResponseBody
|
|||||||
import io.legado.app.help.http.okHttpClient
|
import io.legado.app.help.http.okHttpClient
|
||||||
import io.legado.app.model.analyzeRule.AnalyzeUrl
|
import io.legado.app.model.analyzeRule.AnalyzeUrl
|
||||||
import io.legado.app.model.rss.Rss
|
import io.legado.app.model.rss.Rss
|
||||||
import io.legado.app.utils.DocumentUtils
|
|
||||||
import io.legado.app.utils.FileUtils
|
|
||||||
import io.legado.app.utils.isContentScheme
|
|
||||||
import io.legado.app.utils.toastOnUi
|
import io.legado.app.utils.toastOnUi
|
||||||
import io.legado.app.utils.writeBytes
|
import io.legado.app.utils.writeBytes
|
||||||
import kotlinx.coroutines.Dispatchers.IO
|
import kotlinx.coroutines.Dispatchers.IO
|
||||||
import splitties.init.appCtx
|
import splitties.init.appCtx
|
||||||
import java.io.File
|
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
|
|
||||||
@ -99,6 +94,8 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) {
|
|||||||
appDb.rssStarDao.insert(it)
|
appDb.rssStarDao.insert(it)
|
||||||
}
|
}
|
||||||
contentLiveData.postValue(body)
|
contentLiveData.postValue(body)
|
||||||
|
}.onError {
|
||||||
|
contentLiveData.postValue("加载正文失败\n${it.stackTraceToString()}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user