|
|
@@ -704,14 +704,33 @@ class AnalyzeRule(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 重新获取book
|
|
|
+ */
|
|
|
+ fun reGetBook() {
|
|
|
+ val bookSource = source as? BookSource
|
|
|
+ val book = book as? Book
|
|
|
+ if (bookSource == null || book == null) return
|
|
|
+ runBlocking {
|
|
|
+ WebBook.preciseSearchAwait(this, bookSource, book.name, book.author)
|
|
|
+ .getOrThrow().let {
|
|
|
+ book.bookUrl = it.bookUrl
|
|
|
+ it.variableMap.forEach { entry ->
|
|
|
+ book.putVariable(entry.key, entry.value)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ WebBook.getBookInfoAwait(this, bookSource, book, false)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 更新tocUrl,有些书源目录url定期更新,可以在js调用更新
|
|
|
*/
|
|
|
fun refreshTocUrl() {
|
|
|
+ val bookSource = source as? BookSource
|
|
|
+ val book = book as? Book
|
|
|
+ if (bookSource == null || book == null) return
|
|
|
runBlocking {
|
|
|
- val bookSource = source as? BookSource
|
|
|
- val book = book as? Book
|
|
|
- if (bookSource == null || book == null) return@runBlocking
|
|
|
WebBook.getBookInfoAwait(this, bookSource, book)
|
|
|
}
|
|
|
}
|