Merge pull request #6118 from sauravrao637/errorHandlingInSubcribe

Error handling in subscribe() in DownloadDialog
pull/6414/head
Tobi 2021-05-29 11:30:36 +02:00 zatwierdzone przez GitHub
commit 62b593da08
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 24 dodań i 13 usunięć

Wyświetl plik

@ -312,25 +312,36 @@ public class DownloadDialog extends DialogFragment
private void fetchStreamsSize() { private void fetchStreamsSize() {
disposables.clear(); disposables.clear();
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedVideoStreams) disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedVideoStreams)
.subscribe(result -> { .subscribe(result -> {
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.video_button) { if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId()
setupVideoSpinner(); == R.id.video_button) {
} setupVideoSpinner();
})); }
}, throwable -> ErrorActivity.reportErrorInSnackbar(context,
new ErrorInfo(throwable, UserAction.DOWNLOAD_OPEN_DIALOG,
"Downloading video stream size",
currentInfo.getServiceId()))));
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedAudioStreams) disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedAudioStreams)
.subscribe(result -> { .subscribe(result -> {
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.audio_button) { if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId()
setupAudioSpinner(); == R.id.audio_button) {
} setupAudioSpinner();
})); }
}, throwable -> ErrorActivity.reportErrorInSnackbar(context,
new ErrorInfo(throwable, UserAction.DOWNLOAD_OPEN_DIALOG,
"Downloading audio stream size",
currentInfo.getServiceId()))));
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedSubtitleStreams) disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedSubtitleStreams)
.subscribe(result -> { .subscribe(result -> {
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.subtitle_button) { if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId()
setupSubtitleSpinner(); == R.id.subtitle_button) {
} setupSubtitleSpinner();
})); }
}, throwable -> ErrorActivity.reportErrorInSnackbar(context,
new ErrorInfo(throwable, UserAction.DOWNLOAD_OPEN_DIALOG,
"Downloading subtitle stream size",
currentInfo.getServiceId()))));
} }
@Override @Override