下载类书源文件名:文件链接支持type字段
https://www.example.com/aaaaaa, {type: "txt"} 书名.txt
This commit is contained in:
@@ -241,9 +241,10 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
|
||||
) {
|
||||
execute(scope) {
|
||||
webFiles.clear()
|
||||
val fileName = "${book.name} 作者:${book.author}"
|
||||
val fileNameExcludeExtension = if (book.author.isBlank()) book.name else "${book.name} 作者:${book.author}"
|
||||
book.downloadUrls!!.map {
|
||||
val mFileName = UrlUtil.getFileName(AnalyzeUrl(it, source = bookSource)) ?: fileName
|
||||
val analyzeUrl = AnalyzeUrl(it, source = bookSource)
|
||||
val mFileName = UrlUtil.getFileName(analyzeUrl) ?: "${fileNameExcludeExtension}.${analyzeUrl.type}"
|
||||
WebFile(it, mFileName)
|
||||
}
|
||||
}.onError {
|
||||
|
||||
Reference in New Issue
Block a user