mirror of
https://github.com/yuliskov/SmartTube.git
synced 2025-12-30 18:40:27 -06:00
browse: error fixer upd
This commit is contained in:
Submodule MediaServiceCore updated: 141f49c228...b21961348a
@@ -350,6 +350,10 @@ public class SuggestionsController extends BasePlayerController {
|
||||
}
|
||||
|
||||
private void appendSuggestions(Video video, MediaItemMetadata mediaItemMetadata) {
|
||||
if (video == null || getPlayer() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!video.isRemote && getPlayer().isSuggestionsShown()) {
|
||||
Log.d(TAG, "Suggestions is opened. Seems that user want to stay here.");
|
||||
return;
|
||||
@@ -392,10 +396,6 @@ public class SuggestionsController extends BasePlayerController {
|
||||
videoGroup.setTitle(getContext().getString(R.string.suggestions));
|
||||
}
|
||||
|
||||
//if (groupIndex == 0) {
|
||||
// mergeRemoteAndUserQueueIfNeeded(video, videoGroup);
|
||||
//}
|
||||
|
||||
getPlayer().updateSuggestions(videoGroup);
|
||||
mBrowseProcessor.process(videoGroup);
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import com.liskovsoft.smartyoutubetv2.common.misc.MediaServiceManager;
|
||||
import com.liskovsoft.smartyoutubetv2.common.misc.MediaServiceManager.AccountChangeListener;
|
||||
import com.liskovsoft.smartyoutubetv2.common.prefs.AccountsData;
|
||||
import com.liskovsoft.smartyoutubetv2.common.prefs.MainUIData;
|
||||
import com.liskovsoft.smartyoutubetv2.common.prefs.PlayerTweaksData;
|
||||
import com.liskovsoft.smartyoutubetv2.common.utils.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -1127,6 +1128,16 @@ public class BrowsePresenter extends BasePresenter<BrowseView> implements Sectio
|
||||
errorFragmentData = new SignInError(getContext());
|
||||
}
|
||||
|
||||
// TODO: should we find a better place e.g. RetrofitHelper
|
||||
// java.net.UnknownHostException: Unable to resolve host "www.youtube.com": No address associated with hostname
|
||||
if (error != null && Helpers.contains(error.getMessage(), "No address associated with hostname")) {
|
||||
if (!PlayerTweaksData.instance(getContext()).isIPv4DnsPreferred()) {
|
||||
PlayerTweaksData.instance(getContext()).preferIPv4Dns(true);
|
||||
// Restart app to reinit okhttp internal objects
|
||||
Utils.restartTheApp(getContext());
|
||||
}
|
||||
}
|
||||
|
||||
getView().showError(errorFragmentData);
|
||||
Utils.postDelayed(mRefreshSection, 30_000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user