From e02e87416348606e1f191bba549b02d245f857b5 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 8 May 2022 20:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96tts=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/association/ImportHttpTtsViewModel.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/association/ImportHttpTtsViewModel.kt b/app/src/main/java/io/legado/app/ui/association/ImportHttpTtsViewModel.kt index cdc8f654c..5cbacb09d 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportHttpTtsViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportHttpTtsViewModel.kt @@ -6,12 +6,9 @@ import com.jayway.jsonpath.JsonPath import io.legado.app.R import io.legado.app.base.BaseViewModel import io.legado.app.data.appDb -import io.legado.app.data.entities.BookSource import io.legado.app.data.entities.HttpTTS import io.legado.app.exception.NoStackTraceException import io.legado.app.help.ContentProcessor -import io.legado.app.help.SourceHelp -import io.legado.app.help.config.AppConfig import io.legado.app.help.http.newCallResponseBody import io.legado.app.help.http.okHttpClient import io.legado.app.help.http.text @@ -52,9 +49,13 @@ class ImportHttpTtsViewModel(app: Application) : BaseViewModel(app) { fun importSelect(finally: () -> Unit) { execute { - val keepName = AppConfig.importKeepName - val selectSource = arrayListOf() - SourceHelp.insertBookSource(*selectSource.toTypedArray()) + val selectSource = arrayListOf() + selectStatus.forEachIndexed { index, b -> + if (b) { + selectSource.add(allSources[index]) + } + } + appDb.httpTTSDao.insert(*selectSource.toTypedArray()) ContentProcessor.upReplaceRules() }.onFinally { finally.invoke()