Do not show suggestions error snackbar for interrupted I/O
Fix formatting
This commit is contained in:
parent
d37ee1e0dc
commit
87e7d95966
|
@ -55,6 +55,7 @@ import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQu
|
||||||
import org.schabi.newpipe.fragments.BackPressable;
|
import org.schabi.newpipe.fragments.BackPressable;
|
||||||
import org.schabi.newpipe.fragments.list.BaseListFragment;
|
import org.schabi.newpipe.fragments.list.BaseListFragment;
|
||||||
import org.schabi.newpipe.ktx.AnimationType;
|
import org.schabi.newpipe.ktx.AnimationType;
|
||||||
|
import org.schabi.newpipe.ktx.ExceptionUtils;
|
||||||
import org.schabi.newpipe.local.history.HistoryRecordManager;
|
import org.schabi.newpipe.local.history.HistoryRecordManager;
|
||||||
import org.schabi.newpipe.settings.NewPipeSettings;
|
import org.schabi.newpipe.settings.NewPipeSettings;
|
||||||
import org.schabi.newpipe.util.Constants;
|
import org.schabi.newpipe.util.Constants;
|
||||||
|
@ -782,7 +783,8 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
||||||
&& query.length() >= THRESHOLD_NETWORK_SUGGESTION;
|
&& query.length() >= THRESHOLD_NETWORK_SUGGESTION;
|
||||||
|
|
||||||
if (showLocalSuggestions && shallShowRemoteSuggestionsNow) {
|
if (showLocalSuggestions && shallShowRemoteSuggestionsNow) {
|
||||||
return Observable.zip(getLocalSuggestionsObservable(query, 3),
|
return Observable.zip(
|
||||||
|
getLocalSuggestionsObservable(query, 3),
|
||||||
getRemoteSuggestionsObservable(query),
|
getRemoteSuggestionsObservable(query),
|
||||||
(local, remote) -> {
|
(local, remote) -> {
|
||||||
remote.removeIf(remoteItem -> local.stream().anyMatch(
|
remote.removeIf(remoteItem -> local.stream().anyMatch(
|
||||||
|
@ -810,8 +812,10 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
||||||
if (listNotification.getValue() != null) {
|
if (listNotification.getValue() != null) {
|
||||||
handleSuggestions(listNotification.getValue());
|
handleSuggestions(listNotification.getValue());
|
||||||
}
|
}
|
||||||
} else if (listNotification.isOnError()) {
|
} else if (listNotification.isOnError()
|
||||||
showError(new ErrorInfo(listNotification.getError(),
|
&& listNotification.getError() != null
|
||||||
|
&& !ExceptionUtils.isInterruptedCaused(listNotification.getError())) {
|
||||||
|
showSnackBarError(new ErrorInfo(listNotification.getError(),
|
||||||
UserAction.GET_SUGGESTIONS, searchString, serviceId));
|
UserAction.GET_SUGGESTIONS, searchString, serviceId));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue