mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
6db2f2f390
commit
4a2671c914
@ -46,6 +46,9 @@ object BookController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取封面
|
||||||
|
*/
|
||||||
fun getCover(parameters: Map<String, List<String>>): ReturnData {
|
fun getCover(parameters: Map<String, List<String>>): ReturnData {
|
||||||
val returnData = ReturnData()
|
val returnData = ReturnData()
|
||||||
val coverPath = parameters["path"]?.firstOrNull()
|
val coverPath = parameters["path"]?.firstOrNull()
|
||||||
@ -155,6 +158,9 @@ object BookController {
|
|||||||
return returnData
|
return returnData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存书籍
|
||||||
|
*/
|
||||||
fun saveBook(postData: String?): ReturnData {
|
fun saveBook(postData: String?): ReturnData {
|
||||||
val book = GSON.fromJsonObject<Book>(postData)
|
val book = GSON.fromJsonObject<Book>(postData)
|
||||||
val returnData = ReturnData()
|
val returnData = ReturnData()
|
||||||
@ -170,6 +176,9 @@ object BookController {
|
|||||||
return returnData.setErrorMsg("格式不对")
|
return returnData.setErrorMsg("格式不对")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存进度
|
||||||
|
*/
|
||||||
private fun saveBookReadIndex(book: Book, index: Int) {
|
private fun saveBookReadIndex(book: Book, index: Int) {
|
||||||
book.durChapterIndex = index
|
book.durChapterIndex = index
|
||||||
book.durChapterTime = System.currentTimeMillis()
|
book.durChapterTime = System.currentTimeMillis()
|
||||||
@ -186,6 +195,9 @@ object BookController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加本地书籍
|
||||||
|
*/
|
||||||
fun addLocalBook(parameters: Map<String, List<String>>): ReturnData {
|
fun addLocalBook(parameters: Map<String, List<String>>): ReturnData {
|
||||||
val returnData = ReturnData()
|
val returnData = ReturnData()
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user