|
|
@ -8,7 +8,7 @@ import io.legado.app.help.http.newCallResponseBody |
|
|
|
import io.legado.app.help.http.okHttpClient |
|
|
|
import io.legado.app.help.http.okHttpClient |
|
|
|
import io.legado.app.help.http.text |
|
|
|
import io.legado.app.help.http.text |
|
|
|
import io.legado.app.utils.FileUtils |
|
|
|
import io.legado.app.utils.FileUtils |
|
|
|
import io.legado.app.utils.externalFiles |
|
|
|
import io.legado.app.utils.externalCache |
|
|
|
import okhttp3.MediaType.Companion.toMediaType |
|
|
|
import okhttp3.MediaType.Companion.toMediaType |
|
|
|
import splitties.init.appCtx |
|
|
|
import splitties.init.appCtx |
|
|
|
|
|
|
|
|
|
|
@ -78,8 +78,8 @@ class OnLineImportViewModel(app: Application) : BaseAssociationViewModel(app) { |
|
|
|
else -> { |
|
|
|
else -> { |
|
|
|
val inputStream = rs.byteStream() |
|
|
|
val inputStream = rs.byteStream() |
|
|
|
val file = FileUtils.createFileIfNotExist( |
|
|
|
val file = FileUtils.createFileIfNotExist( |
|
|
|
appCtx.externalFiles, |
|
|
|
appCtx.externalCache, |
|
|
|
"book_cache", |
|
|
|
"download", |
|
|
|
"scheme_import_cache.json" |
|
|
|
"scheme_import_cache.json" |
|
|
|
) |
|
|
|
) |
|
|
|
file.outputStream().use { out -> |
|
|
|
file.outputStream().use { out -> |
|
|
|