mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 16:40:32 +00:00
Use getNextPage() instead of getNextPageUrl()
This commit is contained in:
parent
faa6cb5c7d
commit
dd57e246b8
@ -163,7 +163,7 @@ dependencies {
|
|||||||
exclude module: 'support-annotations'
|
exclude module: 'support-annotations'
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation 'com.github.TeamNewPipe:NewPipeExtractor:54d9e5a2f89d6d739dadb6c744efeaf981c85bef'
|
implementation 'com.github.wb9688:NewPipeExtractor:4890b2906f805ccfccc83be13d954ed2cb8fc4e5'
|
||||||
|
|
||||||
implementation "com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751"
|
implementation "com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751"
|
||||||
implementation "org.jsoup:jsoup:1.13.1"
|
implementation "org.jsoup:jsoup:1.13.1"
|
||||||
|
@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
|
|||||||
|
|
||||||
import org.schabi.newpipe.extractor.ListExtractor;
|
import org.schabi.newpipe.extractor.ListExtractor;
|
||||||
import org.schabi.newpipe.extractor.ListInfo;
|
import org.schabi.newpipe.extractor.ListInfo;
|
||||||
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.util.Constants;
|
import org.schabi.newpipe.util.Constants;
|
||||||
import org.schabi.newpipe.views.NewPipeRecyclerView;
|
import org.schabi.newpipe.views.NewPipeRecyclerView;
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
|
|||||||
protected String url;
|
protected String url;
|
||||||
|
|
||||||
protected I currentInfo;
|
protected I currentInfo;
|
||||||
protected String currentNextPageUrl;
|
protected Page currentNextPage;
|
||||||
protected Disposable currentWorker;
|
protected Disposable currentWorker;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,7 +79,7 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
|
|||||||
public void writeTo(final Queue<Object> objectsToSave) {
|
public void writeTo(final Queue<Object> objectsToSave) {
|
||||||
super.writeTo(objectsToSave);
|
super.writeTo(objectsToSave);
|
||||||
objectsToSave.add(currentInfo);
|
objectsToSave.add(currentInfo);
|
||||||
objectsToSave.add(currentNextPageUrl);
|
objectsToSave.add(currentNextPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -86,7 +87,7 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
|
|||||||
public void readFrom(@NonNull final Queue<Object> savedObjects) throws Exception {
|
public void readFrom(@NonNull final Queue<Object> savedObjects) throws Exception {
|
||||||
super.readFrom(savedObjects);
|
super.readFrom(savedObjects);
|
||||||
currentInfo = (I) savedObjects.poll();
|
currentInfo = (I) savedObjects.poll();
|
||||||
currentNextPageUrl = (String) savedObjects.poll();
|
currentNextPage = (Page) savedObjects.poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////
|
||||||
@ -130,7 +131,7 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
|
|||||||
.subscribe((@NonNull I result) -> {
|
.subscribe((@NonNull I result) -> {
|
||||||
isLoading.set(false);
|
isLoading.set(false);
|
||||||
currentInfo = result;
|
currentInfo = result;
|
||||||
currentNextPageUrl = result.getNextPageUrl();
|
currentNextPage = result.getNextPage();
|
||||||
handleResult(result);
|
handleResult(result);
|
||||||
}, (@NonNull Throwable throwable) -> onError(throwable));
|
}, (@NonNull Throwable throwable) -> onError(throwable));
|
||||||
}
|
}
|
||||||
@ -182,7 +183,7 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
|
|||||||
@Override
|
@Override
|
||||||
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
|
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
|
||||||
super.handleNextItems(result);
|
super.handleNextItems(result);
|
||||||
currentNextPageUrl = result.getNextPageUrl();
|
currentNextPage = result.getNextPage();
|
||||||
infoListAdapter.addInfoItemList(result.getItems());
|
infoListAdapter.addInfoItemList(result.getItems());
|
||||||
|
|
||||||
showListFooter(hasMoreItems());
|
showListFooter(hasMoreItems());
|
||||||
@ -190,7 +191,7 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean hasMoreItems() {
|
protected boolean hasMoreItems() {
|
||||||
return !TextUtils.isEmpty(currentNextPageUrl);
|
return Page.isValid(currentNextPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -403,7 +403,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
|
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
|
||||||
return ExtractorHelper.getMoreChannelItems(serviceId, url, currentNextPageUrl);
|
return ExtractorHelper.getMoreChannelItems(serviceId, url, currentNextPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -555,7 +555,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ChannelPlayQueue(currentInfo.getServiceId(), currentInfo.getUrl(),
|
return new ChannelPlayQueue(currentInfo.getServiceId(), currentInfo.getUrl(),
|
||||||
currentInfo.getNextPageUrl(), streamItems, index);
|
currentInfo.getNextPage(), streamItems, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,7 +71,7 @@ public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
|
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
|
||||||
return ExtractorHelper.getMoreCommentItems(serviceId, currentInfo, currentNextPageUrl);
|
return ExtractorHelper.getMoreCommentItems(serviceId, currentInfo, currentNextPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,7 +44,7 @@ public class DefaultKioskFragment extends KioskFragment {
|
|||||||
name = kioskTranslatedName;
|
name = kioskTranslatedName;
|
||||||
|
|
||||||
currentInfo = null;
|
currentInfo = null;
|
||||||
currentNextPageUrl = null;
|
currentNextPage = null;
|
||||||
} catch (ExtractionException e) {
|
} catch (ExtractionException e) {
|
||||||
onUnrecoverableError(e, UserAction.REQUESTED_KIOSK, "none",
|
onUnrecoverableError(e, UserAction.REQUESTED_KIOSK, "none",
|
||||||
"Loading default kiosk from selected service", 0);
|
"Loading default kiosk from selected service", 0);
|
||||||
|
@ -150,7 +150,7 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
|
public Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
|
||||||
return ExtractorHelper.getMoreKioskItems(serviceId, url, currentNextPageUrl);
|
return ExtractorHelper.getMoreKioskItems(serviceId, url, currentNextPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -229,7 +229,7 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
|
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
|
||||||
return ExtractorHelper.getMorePlaylistItems(serviceId, url, currentNextPageUrl);
|
return ExtractorHelper.getMorePlaylistItems(serviceId, url, currentNextPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -349,7 +349,7 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
|
|||||||
return new PlaylistPlayQueue(
|
return new PlaylistPlayQueue(
|
||||||
currentInfo.getServiceId(),
|
currentInfo.getServiceId(),
|
||||||
currentInfo.getUrl(),
|
currentInfo.getUrl(),
|
||||||
currentInfo.getNextPageUrl(),
|
currentInfo.getNextPage(),
|
||||||
infoItems,
|
infoItems,
|
||||||
index
|
index
|
||||||
);
|
);
|
||||||
|
@ -37,6 +37,7 @@ import org.schabi.newpipe.database.history.model.SearchHistoryEntry;
|
|||||||
import org.schabi.newpipe.extractor.InfoItem;
|
import org.schabi.newpipe.extractor.InfoItem;
|
||||||
import org.schabi.newpipe.extractor.ListExtractor;
|
import org.schabi.newpipe.extractor.ListExtractor;
|
||||||
import org.schabi.newpipe.extractor.NewPipe;
|
import org.schabi.newpipe.extractor.NewPipe;
|
||||||
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.extractor.StreamingService;
|
import org.schabi.newpipe.extractor.StreamingService;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||||
import org.schabi.newpipe.extractor.search.SearchExtractor;
|
import org.schabi.newpipe.extractor.search.SearchExtractor;
|
||||||
@ -123,8 +124,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||||||
|
|
||||||
private Map<Integer, String> menuItemToFilterName;
|
private Map<Integer, String> menuItemToFilterName;
|
||||||
private StreamingService service;
|
private StreamingService service;
|
||||||
private String currentPageUrl;
|
private Page nextPage;
|
||||||
private String nextPageUrl;
|
|
||||||
private String contentCountry;
|
private String contentCountry;
|
||||||
private boolean isSuggestionsEnabled = true;
|
private boolean isSuggestionsEnabled = true;
|
||||||
|
|
||||||
@ -354,15 +354,13 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||||||
@Override
|
@Override
|
||||||
public void writeTo(final Queue<Object> objectsToSave) {
|
public void writeTo(final Queue<Object> objectsToSave) {
|
||||||
super.writeTo(objectsToSave);
|
super.writeTo(objectsToSave);
|
||||||
objectsToSave.add(currentPageUrl);
|
objectsToSave.add(nextPage);
|
||||||
objectsToSave.add(nextPageUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(@NonNull final Queue<Object> savedObjects) throws Exception {
|
public void readFrom(@NonNull final Queue<Object> savedObjects) throws Exception {
|
||||||
super.readFrom(savedObjects);
|
super.readFrom(savedObjects);
|
||||||
currentPageUrl = (String) savedObjects.poll();
|
nextPage = (Page) savedObjects.poll();
|
||||||
nextPageUrl = (String) savedObjects.poll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -845,7 +843,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadMoreItems() {
|
protected void loadMoreItems() {
|
||||||
if (nextPageUrl == null || nextPageUrl.isEmpty()) {
|
if (!Page.isValid(nextPage)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isLoading.set(true);
|
isLoading.set(true);
|
||||||
@ -858,7 +856,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||||||
searchString,
|
searchString,
|
||||||
asList(contentFilter),
|
asList(contentFilter),
|
||||||
sortFilter,
|
sortFilter,
|
||||||
nextPageUrl)
|
nextPage)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.doOnEvent((nextItemsResult, throwable) -> isLoading.set(false))
|
.doOnEvent((nextItemsResult, throwable) -> isLoading.set(false))
|
||||||
@ -962,8 +960,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||||||
}
|
}
|
||||||
|
|
||||||
lastSearchedString = searchString;
|
lastSearchedString = searchString;
|
||||||
nextPageUrl = result.getNextPageUrl();
|
nextPage = result.getNextPage();
|
||||||
currentPageUrl = result.getUrl();
|
|
||||||
|
|
||||||
if (infoListAdapter.getItemsList().size() == 0) {
|
if (infoListAdapter.getItemsList().size() == 0) {
|
||||||
if (!result.getRelatedItems().isEmpty()) {
|
if (!result.getRelatedItems().isEmpty()) {
|
||||||
@ -981,14 +978,15 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||||||
@Override
|
@Override
|
||||||
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
|
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
|
||||||
showListFooter(false);
|
showListFooter(false);
|
||||||
currentPageUrl = result.getNextPageUrl();
|
|
||||||
infoListAdapter.addInfoItemList(result.getItems());
|
infoListAdapter.addInfoItemList(result.getItems());
|
||||||
nextPageUrl = result.getNextPageUrl();
|
nextPage = result.getNextPage();
|
||||||
|
|
||||||
if (!result.getErrors().isEmpty()) {
|
if (!result.getErrors().isEmpty()) {
|
||||||
showSnackBarError(result.getErrors(), UserAction.SEARCHED,
|
showSnackBarError(result.getErrors(), UserAction.SEARCHED,
|
||||||
NewPipe.getNameOfService(serviceId),
|
NewPipe.getNameOfService(serviceId),
|
||||||
"\"" + searchString + "\" → page: " + nextPageUrl, 0);
|
"\"" + searchString + "\" → pageUrl: " + nextPage.getUrl() + ", "
|
||||||
|
+ "pageIds: " + nextPage.getIds() + ", "
|
||||||
|
+ "pageCookies: " + nextPage.getCookies(), 0);
|
||||||
}
|
}
|
||||||
super.handleNextItems(result);
|
super.handleNextItems(result);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import android.util.Log;
|
|||||||
import org.schabi.newpipe.extractor.InfoItem;
|
import org.schabi.newpipe.extractor.InfoItem;
|
||||||
import org.schabi.newpipe.extractor.ListExtractor;
|
import org.schabi.newpipe.extractor.ListExtractor;
|
||||||
import org.schabi.newpipe.extractor.ListInfo;
|
import org.schabi.newpipe.extractor.ListInfo;
|
||||||
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -21,7 +22,7 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> ext
|
|||||||
|
|
||||||
final int serviceId;
|
final int serviceId;
|
||||||
final String baseUrl;
|
final String baseUrl;
|
||||||
String nextUrl;
|
Page nextPage;
|
||||||
|
|
||||||
private transient Disposable fetchReactor;
|
private transient Disposable fetchReactor;
|
||||||
|
|
||||||
@ -29,16 +30,16 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> ext
|
|||||||
this(item.getServiceId(), item.getUrl(), null, Collections.emptyList(), 0);
|
this(item.getServiceId(), item.getUrl(), null, Collections.emptyList(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractInfoPlayQueue(final int serviceId, final String url, final String nextPageUrl,
|
AbstractInfoPlayQueue(final int serviceId, final String url, final Page nextPage,
|
||||||
final List<StreamInfoItem> streams, final int index) {
|
final List<StreamInfoItem> streams, final int index) {
|
||||||
super(index, extractListItems(streams));
|
super(index, extractListItems(streams));
|
||||||
|
|
||||||
this.baseUrl = url;
|
this.baseUrl = url;
|
||||||
this.nextUrl = nextPageUrl;
|
this.nextPage = nextPage;
|
||||||
this.serviceId = serviceId;
|
this.serviceId = serviceId;
|
||||||
|
|
||||||
this.isInitial = streams.isEmpty();
|
this.isInitial = streams.isEmpty();
|
||||||
this.isComplete = !isInitial && (nextPageUrl == null || nextPageUrl.isEmpty());
|
this.isComplete = !isInitial && !Page.isValid(nextPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract String getTag();
|
protected abstract String getTag();
|
||||||
@ -66,7 +67,7 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> ext
|
|||||||
if (!result.hasNextPage()) {
|
if (!result.hasNextPage()) {
|
||||||
isComplete = true;
|
isComplete = true;
|
||||||
}
|
}
|
||||||
nextUrl = result.getNextPageUrl();
|
nextPage = result.getNextPage();
|
||||||
|
|
||||||
append(extractListItems(result.getRelatedItems()));
|
append(extractListItems(result.getRelatedItems()));
|
||||||
|
|
||||||
@ -100,7 +101,7 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> ext
|
|||||||
if (!result.hasNextPage()) {
|
if (!result.hasNextPage()) {
|
||||||
isComplete = true;
|
isComplete = true;
|
||||||
}
|
}
|
||||||
nextUrl = result.getNextPageUrl();
|
nextPage = result.getNextPage();
|
||||||
|
|
||||||
append(extractListItems(result.getItems()));
|
append(extractListItems(result.getItems()));
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.schabi.newpipe.player.playqueue;
|
package org.schabi.newpipe.player.playqueue;
|
||||||
|
|
||||||
|
|
||||||
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.extractor.channel.ChannelInfo;
|
import org.schabi.newpipe.extractor.channel.ChannelInfo;
|
||||||
import org.schabi.newpipe.extractor.channel.ChannelInfoItem;
|
import org.schabi.newpipe.extractor.channel.ChannelInfoItem;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
@ -17,15 +18,15 @@ public final class ChannelPlayQueue extends AbstractInfoPlayQueue<ChannelInfo, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ChannelPlayQueue(final ChannelInfo info) {
|
public ChannelPlayQueue(final ChannelInfo info) {
|
||||||
this(info.getServiceId(), info.getUrl(), info.getNextPageUrl(), info.getRelatedItems(), 0);
|
this(info.getServiceId(), info.getUrl(), info.getNextPage(), info.getRelatedItems(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChannelPlayQueue(final int serviceId,
|
public ChannelPlayQueue(final int serviceId,
|
||||||
final String url,
|
final String url,
|
||||||
final String nextPageUrl,
|
final Page nextPage,
|
||||||
final List<StreamInfoItem> streams,
|
final List<StreamInfoItem> streams,
|
||||||
final int index) {
|
final int index) {
|
||||||
super(serviceId, url, nextPageUrl, streams, index);
|
super(serviceId, url, nextPage, streams, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -41,7 +42,7 @@ public final class ChannelPlayQueue extends AbstractInfoPlayQueue<ChannelInfo, C
|
|||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(getHeadListObserver());
|
.subscribe(getHeadListObserver());
|
||||||
} else {
|
} else {
|
||||||
ExtractorHelper.getMoreChannelItems(this.serviceId, this.baseUrl, this.nextUrl)
|
ExtractorHelper.getMoreChannelItems(this.serviceId, this.baseUrl, this.nextPage)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(getNextPageObserver());
|
.subscribe(getNextPageObserver());
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.schabi.newpipe.player.playqueue;
|
package org.schabi.newpipe.player.playqueue;
|
||||||
|
|
||||||
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.extractor.playlist.PlaylistInfo;
|
import org.schabi.newpipe.extractor.playlist.PlaylistInfo;
|
||||||
import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem;
|
import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
@ -16,15 +17,15 @@ public final class PlaylistPlayQueue extends AbstractInfoPlayQueue<PlaylistInfo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PlaylistPlayQueue(final PlaylistInfo info) {
|
public PlaylistPlayQueue(final PlaylistInfo info) {
|
||||||
this(info.getServiceId(), info.getUrl(), info.getNextPageUrl(), info.getRelatedItems(), 0);
|
this(info.getServiceId(), info.getUrl(), info.getNextPage(), info.getRelatedItems(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlaylistPlayQueue(final int serviceId,
|
public PlaylistPlayQueue(final int serviceId,
|
||||||
final String url,
|
final String url,
|
||||||
final String nextPageUrl,
|
final Page nextPage,
|
||||||
final List<StreamInfoItem> streams,
|
final List<StreamInfoItem> streams,
|
||||||
final int index) {
|
final int index) {
|
||||||
super(serviceId, url, nextPageUrl, streams, index);
|
super(serviceId, url, nextPage, streams, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -40,7 +41,7 @@ public final class PlaylistPlayQueue extends AbstractInfoPlayQueue<PlaylistInfo,
|
|||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(getHeadListObserver());
|
.subscribe(getHeadListObserver());
|
||||||
} else {
|
} else {
|
||||||
ExtractorHelper.getMorePlaylistItems(this.serviceId, this.baseUrl, this.nextUrl)
|
ExtractorHelper.getMorePlaylistItems(this.serviceId, this.baseUrl, this.nextPage)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(getNextPageObserver());
|
.subscribe(getNextPageObserver());
|
||||||
|
@ -33,6 +33,7 @@ import org.schabi.newpipe.extractor.InfoItem;
|
|||||||
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
|
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
|
||||||
import org.schabi.newpipe.extractor.ListInfo;
|
import org.schabi.newpipe.extractor.ListInfo;
|
||||||
import org.schabi.newpipe.extractor.NewPipe;
|
import org.schabi.newpipe.extractor.NewPipe;
|
||||||
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.extractor.StreamingService;
|
import org.schabi.newpipe.extractor.StreamingService;
|
||||||
import org.schabi.newpipe.extractor.channel.ChannelInfo;
|
import org.schabi.newpipe.extractor.channel.ChannelInfo;
|
||||||
import org.schabi.newpipe.extractor.comments.CommentsInfo;
|
import org.schabi.newpipe.extractor.comments.CommentsInfo;
|
||||||
@ -87,14 +88,13 @@ public final class ExtractorHelper {
|
|||||||
final String searchString,
|
final String searchString,
|
||||||
final List<String> contentFilter,
|
final List<String> contentFilter,
|
||||||
final String sortFilter,
|
final String sortFilter,
|
||||||
final String pageUrl) {
|
final Page page) {
|
||||||
checkServiceId(serviceId);
|
checkServiceId(serviceId);
|
||||||
return Single.fromCallable(() ->
|
return Single.fromCallable(() ->
|
||||||
SearchInfo.getMoreItems(NewPipe.getService(serviceId),
|
SearchInfo.getMoreItems(NewPipe.getService(serviceId),
|
||||||
NewPipe.getService(serviceId)
|
NewPipe.getService(serviceId)
|
||||||
.getSearchQHFactory()
|
.getSearchQHFactory()
|
||||||
.fromQuery(searchString, contentFilter, sortFilter),
|
.fromQuery(searchString, contentFilter, sortFilter), page));
|
||||||
pageUrl));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,10 +125,10 @@ public final class ExtractorHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Single<InfoItemsPage> getMoreChannelItems(final int serviceId, final String url,
|
public static Single<InfoItemsPage> getMoreChannelItems(final int serviceId, final String url,
|
||||||
final String nextStreamsUrl) {
|
final Page nextPage) {
|
||||||
checkServiceId(serviceId);
|
checkServiceId(serviceId);
|
||||||
return Single.fromCallable(() ->
|
return Single.fromCallable(() ->
|
||||||
ChannelInfo.getMoreItems(NewPipe.getService(serviceId), url, nextStreamsUrl));
|
ChannelInfo.getMoreItems(NewPipe.getService(serviceId), url, nextPage));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Single<ListInfo<StreamInfoItem>> getFeedInfoFallbackToChannelInfo(
|
public static Single<ListInfo<StreamInfoItem>> getFeedInfoFallbackToChannelInfo(
|
||||||
@ -157,10 +157,10 @@ public final class ExtractorHelper {
|
|||||||
|
|
||||||
public static Single<InfoItemsPage> getMoreCommentItems(final int serviceId,
|
public static Single<InfoItemsPage> getMoreCommentItems(final int serviceId,
|
||||||
final CommentsInfo info,
|
final CommentsInfo info,
|
||||||
final String nextPageUrl) {
|
final Page nextPage) {
|
||||||
checkServiceId(serviceId);
|
checkServiceId(serviceId);
|
||||||
return Single.fromCallable(() ->
|
return Single.fromCallable(() ->
|
||||||
CommentsInfo.getMoreItems(NewPipe.getService(serviceId), info, nextPageUrl));
|
CommentsInfo.getMoreItems(NewPipe.getService(serviceId), info, nextPage));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Single<PlaylistInfo> getPlaylistInfo(final int serviceId, final String url,
|
public static Single<PlaylistInfo> getPlaylistInfo(final int serviceId, final String url,
|
||||||
@ -172,10 +172,10 @@ public final class ExtractorHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Single<InfoItemsPage> getMorePlaylistItems(final int serviceId, final String url,
|
public static Single<InfoItemsPage> getMorePlaylistItems(final int serviceId, final String url,
|
||||||
final String nextStreamsUrl) {
|
final Page nextPage) {
|
||||||
checkServiceId(serviceId);
|
checkServiceId(serviceId);
|
||||||
return Single.fromCallable(() ->
|
return Single.fromCallable(() ->
|
||||||
PlaylistInfo.getMoreItems(NewPipe.getService(serviceId), url, nextStreamsUrl));
|
PlaylistInfo.getMoreItems(NewPipe.getService(serviceId), url, nextPage));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Single<KioskInfo> getKioskInfo(final int serviceId, final String url,
|
public static Single<KioskInfo> getKioskInfo(final int serviceId, final String url,
|
||||||
@ -184,12 +184,10 @@ public final class ExtractorHelper {
|
|||||||
Single.fromCallable(() -> KioskInfo.getInfo(NewPipe.getService(serviceId), url)));
|
Single.fromCallable(() -> KioskInfo.getInfo(NewPipe.getService(serviceId), url)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Single<InfoItemsPage> getMoreKioskItems(final int serviceId,
|
public static Single<InfoItemsPage> getMoreKioskItems(final int serviceId, final String url,
|
||||||
final String url,
|
final Page nextPage) {
|
||||||
final String nextStreamsUrl) {
|
|
||||||
return Single.fromCallable(() ->
|
return Single.fromCallable(() ->
|
||||||
KioskInfo.getMoreItems(NewPipe.getService(serviceId),
|
KioskInfo.getMoreItems(NewPipe.getService(serviceId), url, nextPage));
|
||||||
url, nextStreamsUrl));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////
|
||||||
@ -240,8 +238,8 @@ public final class ExtractorHelper {
|
|||||||
* @param infoType the {@link InfoItem.InfoType} of the item
|
* @param infoType the {@link InfoItem.InfoType} of the item
|
||||||
* @return a {@link Single} that loads the item
|
* @return a {@link Single} that loads the item
|
||||||
*/
|
*/
|
||||||
public static <I extends Info> Maybe<I> loadFromCache(final int serviceId, final String url,
|
private static <I extends Info> Maybe<I> loadFromCache(final int serviceId, final String url,
|
||||||
final InfoItem.InfoType infoType) {
|
final InfoItem.InfoType infoType) {
|
||||||
checkServiceId(serviceId);
|
checkServiceId(serviceId);
|
||||||
return Maybe.defer(() -> {
|
return Maybe.defer(() -> {
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
|
Loading…
Reference in New Issue
Block a user