Reuse generated backup file if it's less than one hour old and enable resumable upload.

This commit is contained in:
Alex Hart
2024-12-05 09:51:50 -04:00
committed by Greyson Parrelli
parent 6d415ca85a
commit 9389f373c6
5 changed files with 224 additions and 39 deletions

View File

@@ -196,7 +196,7 @@ class InternalBackupPlaygroundViewModel : ViewModel() {
_state.value = _state.value.copy(uploadState = BackupUploadState.UPLOAD_IN_PROGRESS)
disposables += Single
.fromCallable { BackupRepository.uploadBackupFile(backupData!!.inputStream(), backupData!!.size.toLong()) is NetworkResult.Success }
.fromCallable { BackupRepository.debugUploadBackupFile(backupData!!.inputStream(), backupData!!.size.toLong()) is NetworkResult.Success }
.subscribeOn(Schedulers.io())
.subscribe { success ->
_state.value = _state.value.copy(uploadState = if (success) BackupUploadState.UPLOAD_DONE else BackupUploadState.UPLOAD_FAILED)