mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixed #764
This commit is contained in:
parent
3bad9cad5e
commit
8bbb20557f
1 changed files with 10 additions and 3 deletions
|
@ -29,7 +29,7 @@ import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
object BackupUtils {
|
object BackupUtils {
|
||||||
var restoreFileSelector: ActivityResultLauncher<String>? = null
|
var restoreFileSelector: ActivityResultLauncher<Array<String>>? = null
|
||||||
|
|
||||||
// Kinda hack, but I couldn't think of a better way
|
// Kinda hack, but I couldn't think of a better way
|
||||||
data class BackupVars(
|
data class BackupVars(
|
||||||
|
@ -143,7 +143,7 @@ object BackupUtils {
|
||||||
fun FragmentActivity.setUpBackup() {
|
fun FragmentActivity.setUpBackup() {
|
||||||
try {
|
try {
|
||||||
restoreFileSelector =
|
restoreFileSelector =
|
||||||
registerForActivityResult(ActivityResultContracts.GetContent()) { uri: Uri? ->
|
registerForActivityResult(ActivityResultContracts.OpenDocument()) { uri: Uri? ->
|
||||||
this.let { activity ->
|
this.let { activity ->
|
||||||
uri?.let {
|
uri?.let {
|
||||||
try {
|
try {
|
||||||
|
@ -180,7 +180,14 @@ object BackupUtils {
|
||||||
|
|
||||||
fun FragmentActivity.restorePrompt() {
|
fun FragmentActivity.restorePrompt() {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
restoreFileSelector?.launch("application/json")
|
restoreFileSelector?.launch(
|
||||||
|
arrayOf(
|
||||||
|
"text/plain",
|
||||||
|
"text/str",
|
||||||
|
"text/x-unknown",
|
||||||
|
"application/json"
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue