|
|
@ -5,6 +5,7 @@ import android.net.Uri |
|
|
|
import androidx.documentfile.provider.DocumentFile |
|
|
|
import androidx.documentfile.provider.DocumentFile |
|
|
|
import androidx.lifecycle.MutableLiveData |
|
|
|
import androidx.lifecycle.MutableLiveData |
|
|
|
import io.legado.app.base.BaseViewModel |
|
|
|
import io.legado.app.base.BaseViewModel |
|
|
|
|
|
|
|
import io.legado.app.constant.AppLog |
|
|
|
import io.legado.app.help.DirectLinkUpload |
|
|
|
import io.legado.app.help.DirectLinkUpload |
|
|
|
import io.legado.app.utils.FileUtils |
|
|
|
import io.legado.app.utils.FileUtils |
|
|
|
import io.legado.app.utils.isContentScheme |
|
|
|
import io.legado.app.utils.isContentScheme |
|
|
@ -27,6 +28,7 @@ class HandleFileViewModel(application: Application) : BaseViewModel(application) |
|
|
|
}.onSuccess { |
|
|
|
}.onSuccess { |
|
|
|
success.invoke(it) |
|
|
|
success.invoke(it) |
|
|
|
}.onError { |
|
|
|
}.onError { |
|
|
|
|
|
|
|
AppLog.addLog("上传文件失败\n${it.localizedMessage}", it) |
|
|
|
it.printOnDebug() |
|
|
|
it.printOnDebug() |
|
|
|
errorLiveData.postValue(it.localizedMessage) |
|
|
|
errorLiveData.postValue(it.localizedMessage) |
|
|
|
} |
|
|
|
} |
|
|
|