|
@@ -684,27 +684,6 @@ class AnalyzeRule(
|
|
|
return s
|
|
return s
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 更新BookUrl,如果搜索结果有tocUrl也会更新,有些书源bookUrl定期更新,可以在js内调用更新
|
|
|
|
|
- */
|
|
|
|
|
- fun refreshBookUrl() {
|
|
|
|
|
- runBlocking {
|
|
|
|
|
- val bookSource = source as? BookSource
|
|
|
|
|
- val book = book as? Book
|
|
|
|
|
- if (bookSource == null || book == null) return@runBlocking
|
|
|
|
|
- val books = WebBook.searchBookAwait(this, bookSource, book.name)
|
|
|
|
|
- books.forEach {
|
|
|
|
|
- if (it.name == book.name && it.author == book.author) {
|
|
|
|
|
- book.bookUrl = it.bookUrl
|
|
|
|
|
- if (it.tocUrl.isNotBlank()) {
|
|
|
|
|
- book.tocUrl = it.tocUrl
|
|
|
|
|
- }
|
|
|
|
|
- return@runBlocking
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 重新获取book
|
|
* 重新获取book
|
|
|
*/
|
|
*/
|
|
@@ -726,6 +705,20 @@ class AnalyzeRule(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 刷新详情页
|
|
|
|
|
+ */
|
|
|
|
|
+ fun refreshBook() {
|
|
|
|
|
+ val bookSource = source as? BookSource
|
|
|
|
|
+ val book = book as? Book
|
|
|
|
|
+ if (bookSource == null || book == null) return
|
|
|
|
|
+ runBlocking {
|
|
|
|
|
+ withTimeout(1800000) {
|
|
|
|
|
+ WebBook.getBookInfoAwait(this, bookSource, book)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 更新tocUrl,有些书源目录url定期更新,可以在js调用更新
|
|
* 更新tocUrl,有些书源目录url定期更新,可以在js调用更新
|
|
|
*/
|
|
*/
|