mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -8,6 +8,7 @@ import io.legado.app.constant.PreferKey
|
||||
import io.legado.app.data.appDb
|
||||
import io.legado.app.data.entities.Book
|
||||
import io.legado.app.help.BookHelp
|
||||
import io.legado.app.help.CacheManager
|
||||
import io.legado.app.help.ContentProcessor
|
||||
import io.legado.app.help.glide.ImageLoader
|
||||
import io.legado.app.help.storage.AppWebDav
|
||||
@@ -232,4 +233,18 @@ object BookController {
|
||||
return returnData.setData(true)
|
||||
}
|
||||
|
||||
fun saveWebReadConfig(postData: String?): ReturnData {
|
||||
val returnData = ReturnData()
|
||||
postData?.let {
|
||||
CacheManager.put("webReadConfig", postData)
|
||||
}
|
||||
return returnData.setData("")
|
||||
}
|
||||
|
||||
fun getWebReadConfig(): ReturnData {
|
||||
val returnData = ReturnData()
|
||||
val data = CacheManager.get("webReadConfig") ?: "{}"
|
||||
return returnData.setData(data)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class HttpServer(port: Int) : NanoHTTPD(port) {
|
||||
"/deleteBookSources" -> BookSourceController.deleteSources(postData)
|
||||
"/saveBook" -> BookController.saveBook(postData)
|
||||
"/addLocalBook" -> BookController.addLocalBook(session.parameters)
|
||||
"/saveReadConfig" -> BookController.saveWebReadConfig(postData)
|
||||
"/saveRssSource" -> RssSourceController.saveSource(postData)
|
||||
"/saveRssSources" -> RssSourceController.saveSources(postData)
|
||||
"/deleteRssSources" -> RssSourceController.deleteSources(postData)
|
||||
@@ -61,6 +62,7 @@ class HttpServer(port: Int) : NanoHTTPD(port) {
|
||||
"/refreshToc" -> BookController.refreshToc(parameters)
|
||||
"/getBookContent" -> BookController.getBookContent(parameters)
|
||||
"/cover" -> BookController.getCover(parameters)
|
||||
"/getReadConfig" -> BookController.getWebReadConfig()
|
||||
"/getRssSource" -> RssSourceController.getSource(parameters)
|
||||
"/getRssSources" -> RssSourceController.sources
|
||||
else -> null
|
||||
|
||||
Reference in New Issue
Block a user