Reimplement storing backup import/export path

#6319 and #6402 were reverted before adding SAF changes, and have been readded at the end of SAF changes
This commit is contained in:
Stypox 2021-06-06 22:15:32 +02:00
parent 5ffc667bea
commit 2a99e0e435
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
7 changed files with 155 additions and 55 deletions

View file

@ -702,9 +702,9 @@ public class DownloadDialog extends DialogFragment
}
if (askForSavePath) {
final String startPath;
final Uri initialPath;
if (NewPipeSettings.useStorageAccessFramework(context)) {
startPath = null;
initialPath = null;
} else {
final File initialSavePath;
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.audio_button) {
@ -712,11 +712,11 @@ public class DownloadDialog extends DialogFragment
} else {
initialSavePath = NewPipeSettings.getDir(Environment.DIRECTORY_MOVIES);
}
startPath = initialSavePath.getAbsolutePath();
initialPath = Uri.parse(initialSavePath.getAbsolutePath());
}
startActivityForResult(StoredFileHelper.getNewPicker(context, startPath,
filenameTmp, mimeTmp), REQUEST_DOWNLOAD_SAVE_AS);
startActivityForResult(StoredFileHelper.getNewPicker(context,
filenameTmp, mimeTmp, initialPath), REQUEST_DOWNLOAD_SAVE_AS);
return;
}