diff --git a/MediaServiceCore b/MediaServiceCore index 141f49c22..b21961348 160000 --- a/MediaServiceCore +++ b/MediaServiceCore @@ -1 +1 @@ -Subproject commit 141f49c2285e9f76fe613360b73a1497bb636828 +Subproject commit b21961348a32e3ab0231c19c924657954560f76d diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/controllers/SuggestionsController.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/controllers/SuggestionsController.java index e1c47c787..84a0e3ad7 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/controllers/SuggestionsController.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/models/playback/controllers/SuggestionsController.java @@ -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); diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java index 6337786ed..9be57371a 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java @@ -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 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); }