This commit is contained in:
Horis
2025-05-02 15:47:05 +08:00
parent 9f2e507caa
commit 2a9b8c24c2

View File

@@ -12,6 +12,7 @@ import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookChapter
import io.legado.app.data.entities.BookSource
import io.legado.app.data.entities.RssArticle
import io.legado.app.exception.NoStackTraceException
import io.legado.app.help.CacheManager
import io.legado.app.help.JsExtensions
import io.legado.app.help.http.CookieStore
@@ -816,7 +817,7 @@ class AnalyzeRule(
* 重新获取book
*/
fun reGetBook() {
if (!preUpdateJs) return
if (!preUpdateJs) throw NoStackTraceException("只能在 preUpdateJs 中调用")
val bookSource = source as? BookSource
val book = book as? Book
if (bookSource == null || book == null) return
@@ -838,7 +839,7 @@ class AnalyzeRule(
* 更新tocUrl,有些书源目录url定期更新,可以在js调用更新
*/
fun refreshTocUrl() {
if (!preUpdateJs) return
if (!preUpdateJs) throw NoStackTraceException("只能在 preUpdateJs 中调用")
val bookSource = source as? BookSource
val book = book as? Book
if (bookSource == null || book == null) return