Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.evernote.android.state.State;

Expand Down Expand Up @@ -42,6 +43,7 @@ public abstract class BaseListInfoFragment<I extends InfoItem, L extends ListInf

private final UserAction errorUserAction;
protected L currentInfo;
@Nullable
protected Page currentNextPage;
protected Disposable currentWorker;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I

private final SparseArrayCompat<String> menuItemToFilterName = new SparseArrayCompat<>();
private StreamingService service;
@Nullable
private Page nextPage;
private boolean showLocalSuggestions = true;
private boolean showRemoteSuggestions = true;
Expand Down Expand Up @@ -1090,7 +1091,7 @@ public void handleNextItems(final ListExtractor.InfoItemsPage<?> result) {
infoListAdapter.addInfoItemList(result.getItems());
nextPage = result.getNextPage();

if (!result.getErrors().isEmpty()) {
if (!result.getErrors().isEmpty() && nextPage != null) {
Copy link
Contributor

@TobiGr TobiGr Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, why is the nextPageInfo included in the error?
The nextPage might be null, but that does not mean that the extraction of the current page does not have any errors. We'd still want to get error reports in case the nextPage couldn't be extracted. The reassignment of nextPage needs to happen after the error report is generated.

showSnackBarError(new ErrorInfo(result.getErrors(), UserAction.SEARCHED,
"\"" + searchString + "\" → pageUrl: " + nextPage.getUrl() + ", "
+ "pageIds: " + nextPage.getIds() + ", "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.schabi.newpipe.extractor.InfoItem;
import org.schabi.newpipe.extractor.ListExtractor;
Expand All @@ -23,6 +24,7 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo<? extends InfoItem>>

final int serviceId;
final String baseUrl;
@Nullable
Page nextPage;

private transient Disposable fetchReactor;
Expand Down