优化
This commit is contained in:
@@ -88,7 +88,7 @@ interface BookDao {
|
||||
@Query("select 1 from books where bookUrl = :bookUrl")
|
||||
fun has(bookUrl: String): Boolean?
|
||||
|
||||
@Query("select 1 from books where bookUrl like '%' || :fileName")
|
||||
@Query("select 1 from books where originName = :fileName")
|
||||
fun hasFile(fileName: String): Boolean?
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
|
||||
@@ -18,7 +18,6 @@ import io.legado.app.model.analyzeRule.AnalyzeUrl
|
||||
import io.legado.app.utils.*
|
||||
import splitties.init.appCtx
|
||||
import java.io.*
|
||||
import java.net.URLEncoder
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/**
|
||||
@@ -275,7 +274,6 @@ object LocalBook {
|
||||
fileName: String
|
||||
): Boolean {
|
||||
return appDb.bookDao.hasFile(fileName) == true
|
||||
|| appDb.bookDao.hasFile(URLEncoder.encode(fileName, "UTF-8")) == true
|
||||
}
|
||||
|
||||
//文件类书源 合并在线书籍信息 在线 > 本地
|
||||
|
||||
@@ -206,6 +206,7 @@ class ImportBookActivity : VMBaseActivity<ActivityImportBookBinding, ImportBookV
|
||||
|
||||
@Synchronized
|
||||
private fun upPath() {
|
||||
binding.tvGoBack.isEnabled = viewModel.subDocs.isNotEmpty()
|
||||
viewModel.rootDoc?.let {
|
||||
scanDocJob?.cancel()
|
||||
upDocs(it)
|
||||
|
||||
@@ -6,7 +6,7 @@ data class RemoteBook(
|
||||
val size: Long,
|
||||
val contentType: String,
|
||||
val lastModify: Long,
|
||||
var isOnBookShelf: Boolean
|
||||
var isOnBookShelf: Boolean = false
|
||||
) {
|
||||
|
||||
val isDir by lazy {
|
||||
|
||||
@@ -98,6 +98,7 @@ class RemoteBookActivity : VMBaseActivity<ActivityImportBookBinding, RemoteBookV
|
||||
}
|
||||
|
||||
private fun upPath() {
|
||||
binding.tvGoBack.isEnabled = viewModel.dirList.isNotEmpty()
|
||||
var path = "books" + File.separator
|
||||
viewModel.dirList.forEach {
|
||||
path = path + it.filename + File.separator
|
||||
|
||||
@@ -47,7 +47,7 @@ object RemoteBookWebDav : RemoteBookManager() {
|
||||
remoteBooks.add(
|
||||
RemoteBook(
|
||||
webDavFile.displayName, webDavFile.path, webDavFile.size,
|
||||
"folder", webDavFile.lastModify, false
|
||||
"folder", webDavFile.lastModify
|
||||
)
|
||||
)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user