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

This commit is contained in:
Kai DeLorenzo 2024-07-05 11:48:35 -05:00
commit da6eef905c
No known key found for this signature in database

View file

@ -1250,7 +1250,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) {
@ -2546,6 +2546,7 @@ 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);
if(!(it.message?.contains("Unable to resolve host") ?: false && nextVideo())){
handleErrorOrCall { handleErrorOrCall {
_retryCount = 0; _retryCount = 0;
_retryJob?.cancel(); _retryJob?.cancel();
@ -2554,6 +2555,7 @@ class VideoDetailView : ConstraintLayout {
_liveTryJob = null; _liveTryJob = null;
UIDialogs.showGeneralRetryErrorDialog(context, context.getString(R.string.failed_to_load_video), it, ::fetchVideo, null, fragment); 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});
private val _taskLoadPolycentricProfile = TaskHandler<PlatformID, PolycentricCache.CachedPolycentricProfile?>(StateApp.instance.scopeGetter, { PolycentricCache.instance.getProfileAsync(it) }) private val _taskLoadPolycentricProfile = TaskHandler<PlatformID, PolycentricCache.CachedPolycentricProfile?>(StateApp.instance.scopeGetter, { PolycentricCache.instance.getProfileAsync(it) })