Merge pull request #1673 from Xwite/master

设置web正文图片宽度为640
pull/1678/head
kunfei 3 years ago committed by GitHub
commit c45285cb99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/src/main/assets/web/bookshelf/css/detail.cfefeb27.css
  2. 1
      app/src/main/assets/web/bookshelf/js/about.29795c94.js
  3. 1
      app/src/main/assets/web/bookshelf/js/about~detail.67be2f55.js
  4. 1
      app/src/main/assets/web/bookshelf/js/app.79f613ac.js
  5. 33
      app/src/main/assets/web/bookshelf/js/chunk-vendors.6d9073dd.js
  6. 1
      app/src/main/assets/web/bookshelf/js/detail.989b5dbd.js
  7. 12
      app/src/main/java/io/legado/app/api/controller/BookController.kt

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -26,7 +26,6 @@ import kotlinx.coroutines.runBlocking
import splitties.init.appCtx
import java.io.File
import java.io.FileOutputStream
import java.net.URLDecoder
object BookController {
@ -57,7 +56,7 @@ object BookController {
*/
fun getCover(parameters: Map<String, List<String>>): ReturnData {
val returnData = ReturnData()
val coverPath = URLDecoder.decode(parameters["path"]?.firstOrNull(), "UTF-8")
val coverPath = parameters["path"]?.firstOrNull()
val ftBitmap = ImageLoader.loadBitmap(appCtx, coverPath).submit()
return try {
returnData.setData(ftBitmap.get())
@ -73,9 +72,10 @@ object BookController {
val returnData = ReturnData()
val bookUrl = parameters["url"]?.firstOrNull()
?: return returnData.setErrorMsg("bookUrl为空")
val book = appDb.bookDao.getBook(URLDecoder.decode(bookUrl, "UTF-8"))
?: return returnData.setErrorMsg("bookUrl不对")
val src = URLDecoder.decode(parameters["path"]?.firstOrNull(), "UTF-8")
val book = appDb.bookDao.getBook(bookUrl)
?: return returnData.setErrorMsg("bookUrl不对:${bookUrl}")
val src = parameters["path"]?.firstOrNull()
?: return returnData.setErrorMsg("图片链接为空")
val vFile = BookHelp.getImage(book, src)
if (!vFile.exists()) {
val bookSource = appDb.bookSourceDao.getBookSource(book.origin)
@ -84,7 +84,7 @@ object BookController {
}
}
return returnData.setData(
BitmapUtils.decodeBitmap(vFile.absolutePath)
BitmapUtils.decodeBitmap(vFile.absolutePath, 640, 640)
)
}

Loading…
Cancel
Save