mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	Merge pull request #6118 from sauravrao637/errorHandlingInSubcribe
Error handling in subscribe() in DownloadDialog
This commit is contained in:
		| @@ -312,25 +312,36 @@ 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) { | ||||
|                     if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() | ||||
|                             == 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) | ||||
|                 .subscribe(result -> { | ||||
|             if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.audio_button) { | ||||
|                     if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() | ||||
|                             == 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) | ||||
|                 .subscribe(result -> { | ||||
|             if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.subtitle_button) { | ||||
|                     if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() | ||||
|                             == R.id.subtitle_button) { | ||||
|                         setupSubtitleSpinner(); | ||||
|                     } | ||||
|         })); | ||||
|                 }, throwable -> ErrorActivity.reportErrorInSnackbar(context, | ||||
|                         new ErrorInfo(throwable, UserAction.DOWNLOAD_OPEN_DIALOG, | ||||
|                                 "Downloading subtitle stream size", | ||||
|                                 currentInfo.getServiceId())))); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tobi
					Tobi