|
@@ -4,10 +4,7 @@ package io.legado.app.help.book
|
|
|
|
|
|
|
|
import android.net.Uri
|
|
import android.net.Uri
|
|
|
import com.script.SimpleBindings
|
|
import com.script.SimpleBindings
|
|
|
-import io.legado.app.constant.AppConst
|
|
|
|
|
-import io.legado.app.constant.AppLog
|
|
|
|
|
-import io.legado.app.constant.BookSourceType
|
|
|
|
|
-import io.legado.app.constant.BookType
|
|
|
|
|
|
|
+import io.legado.app.constant.*
|
|
|
import io.legado.app.data.appDb
|
|
import io.legado.app.data.appDb
|
|
|
import io.legado.app.data.entities.BaseBook
|
|
import io.legado.app.data.entities.BaseBook
|
|
|
import io.legado.app.data.entities.Book
|
|
import io.legado.app.data.entities.Book
|
|
@@ -241,7 +238,7 @@ fun Book.getExportFileName(suffix: String): String {
|
|
|
bindings["name"] = name
|
|
bindings["name"] = name
|
|
|
bindings["author"] = getRealAuthor()
|
|
bindings["author"] = getRealAuthor()
|
|
|
return kotlin.runCatching {
|
|
return kotlin.runCatching {
|
|
|
- AppConst.SCRIPT_ENGINE.eval(jsStr, bindings).toString() + "." + suffix
|
|
|
|
|
|
|
+ SCRIPT_ENGINE.eval(jsStr, bindings).toString() + "." + suffix
|
|
|
}.onFailure {
|
|
}.onFailure {
|
|
|
AppLog.put("导出书名规则错误,使用默认规则\n${it.localizedMessage}", it)
|
|
AppLog.put("导出书名规则错误,使用默认规则\n${it.localizedMessage}", it)
|
|
|
}.getOrDefault("${name} 作者:${getRealAuthor()}.$suffix")
|
|
}.getOrDefault("${name} 作者:${getRealAuthor()}.$suffix")
|