Error handling in subscribe() in DownloadDialog

This commit is contained in:
camo0112 2021-04-20 13:06:40 +05:30
parent c12ac64678
commit 67c0ceedc9
1 changed files with 15 additions and 13 deletions

View File

@ -312,25 +312,27 @@ public class DownloadDialog extends DialogFragment
private void fetchStreamsSize() {
disposables.clear();
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedVideoStreams)
.subscribe(result -> {
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.video_button) {
setupVideoSpinner();
}
}));
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId()
== R.id.video_button) {
setupVideoSpinner();
}
}, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage())));
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedAudioStreams)
.subscribe(result -> {
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.audio_button) {
setupAudioSpinner();
}
}));
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId()
== R.id.audio_button) {
setupAudioSpinner();
}
}, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage())));
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedSubtitleStreams)
.subscribe(result -> {
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.subtitle_button) {
setupSubtitleSpinner();
}
}));
if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId()
== R.id.subtitle_button) {
setupSubtitleSpinner();
}
}, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage())));
}
@Override