diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelTabPlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelTabPlaylistExtractor.java index da50db631..26ccd6d94 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelTabPlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelTabPlaylistExtractor.java @@ -1,6 +1,7 @@ package org.schabi.newpipe.extractor.services.youtube.extractors; -import org.schabi.newpipe.extractor.InfoItem; +import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; + import org.schabi.newpipe.extractor.Page; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.channel.tabs.ChannelTabExtractor; @@ -12,14 +13,11 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; import org.schabi.newpipe.extractor.playlist.PlaylistExtractor; import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubePlaylistLinkHandlerFactory; -import org.schabi.newpipe.extractor.stream.StreamInfoItem; -import javax.annotation.Nonnull; import java.io.IOException; -import java.util.ArrayList; import java.util.List; -import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; +import javax.annotation.Nonnull; /** * A {@link ChannelTabExtractor} for YouTube system playlists using a @@ -74,35 +72,19 @@ public class YoutubeChannelTabPlaylistExtractor extends ChannelTabExtractor { @Nonnull @Override - public InfoItemsPage getInitialPage() throws IOException, ExtractionException { + public InfoItemsPage getInitialPage() throws IOException, ExtractionException { if (!playlistExisting) { return InfoItemsPage.emptyPage(); } - - final InfoItemsPage playlistInitialPage = - playlistExtractorInstance.getInitialPage(); - - // We can't provide the playlist page as it is due to a type conflict, we need to wrap the - // page items and provide a new InfoItemsPage - final List infoItems = new ArrayList<>(playlistInitialPage.getItems()); - return new InfoItemsPage<>(infoItems, playlistInitialPage.getNextPage(), - playlistInitialPage.getErrors()); + return playlistExtractorInstance.getInitialPage(); } @Override - public InfoItemsPage getPage(final Page page) - throws IOException, ExtractionException { + public InfoItemsPage getPage(final Page page) throws IOException, ExtractionException { if (!playlistExisting) { return InfoItemsPage.emptyPage(); } - - final InfoItemsPage playlistPage = playlistExtractorInstance.getPage(page); - - // We can't provide the playlist page as it is due to a type conflict, we need to wrap the - // page items and provide a new InfoItemsPage - final List infoItems = new ArrayList<>(playlistPage.getItems()); - return new InfoItemsPage<>(infoItems, playlistPage.getNextPage(), - playlistPage.getErrors()); + return playlistExtractorInstance.getPage(page); } /**