|
|
@ -12,9 +12,9 @@ import io.legado.app.model.Debug |
|
|
|
import io.legado.app.model.analyzeRule.AnalyzeRule |
|
|
|
import io.legado.app.model.analyzeRule.AnalyzeRule |
|
|
|
import io.legado.app.model.analyzeRule.AnalyzeUrl |
|
|
|
import io.legado.app.model.analyzeRule.AnalyzeUrl |
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
|
|
|
|
import kotlinx.coroutines.suspendCancellableCoroutine |
|
|
|
import kotlin.coroutines.resume |
|
|
|
import kotlin.coroutines.resume |
|
|
|
import kotlin.coroutines.resumeWithException |
|
|
|
import kotlin.coroutines.resumeWithException |
|
|
|
import kotlin.coroutines.suspendCoroutine |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
object BookChapterList { |
|
|
|
object BookChapterList { |
|
|
|
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ object BookChapterList { |
|
|
|
body: String?, |
|
|
|
body: String?, |
|
|
|
bookSource: BookSource, |
|
|
|
bookSource: BookSource, |
|
|
|
baseUrl: String |
|
|
|
baseUrl: String |
|
|
|
): List<BookChapter> = suspendCoroutine { block -> |
|
|
|
): List<BookChapter> = suspendCancellableCoroutine { block -> |
|
|
|
try { |
|
|
|
try { |
|
|
|
val chapterList = ArrayList<BookChapter>() |
|
|
|
val chapterList = ArrayList<BookChapter>() |
|
|
|
body ?: throw Exception( |
|
|
|
body ?: throw Exception( |
|
|
|