Merge branch 'ignore-offline-error' into 'master'

hide unable to resolve host exceptions when there are more videos in a playlist

See merge request videostreaming/grayjay!24
This commit is contained in:
Koen 2024-11-21 09:43:52 +00:00
commit 8950bd94cb

View File

@ -1352,7 +1352,7 @@ class VideoDetailView : ConstraintLayout {
} }
catch(ex: Throwable) { catch(ex: Throwable) {
Logger.e(TAG, "Playback tracker failed", ex); Logger.e(TAG, "Playback tracker failed", ex);
if(me.video?.isLive == true) withContext(Dispatchers.Main) { if(me.video?.isLive == true || ex.message?.contains("Unable to resolve host") == true) withContext(Dispatchers.Main) {
UIDialogs.toast(context, context.getString(R.string.failed_to_get_playback_tracker)); UIDialogs.toast(context, context.getString(R.string.failed_to_get_playback_tracker));
}; };
else withContext(Dispatchers.Main) { else withContext(Dispatchers.Main) {
@ -2823,13 +2823,15 @@ class VideoDetailView : ConstraintLayout {
.exception<Throwable> { .exception<Throwable> {
Logger.w(ChannelFragment.TAG, "Failed to load video.", it); Logger.w(ChannelFragment.TAG, "Failed to load video.", it);
handleErrorOrCall { if(!(it.message?.contains("Unable to resolve host") ?: false && nextVideo())){
_retryCount = 0; handleErrorOrCall {
_retryJob?.cancel(); _retryCount = 0;
_retryJob = null; _retryJob?.cancel();
_liveTryJob?.cancel(); _retryJob = null;
_liveTryJob = null; _liveTryJob?.cancel();
UIDialogs.showGeneralRetryErrorDialog(context, context.getString(R.string.failed_to_load_video), it, ::fetchVideo, null, fragment); _liveTryJob = null;
UIDialogs.showGeneralRetryErrorDialog(context, context.getString(R.string.failed_to_load_video), it, ::fetchVideo, null, fragment);
}
} }
} else TaskHandler(IPlatformVideoDetails::class.java, {fragment.lifecycleScope}); } else TaskHandler(IPlatformVideoDetails::class.java, {fragment.lifecycleScope});