File tree Expand file tree Collapse file tree
app/src/main/java/com/github/libretube/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -393,12 +393,22 @@ class NewPipeMediaServiceRepository : MediaServiceRepository {
393393 override suspend fun getChannelTab (data : String , nextPage : String? ): ChannelTabResponse {
394394 val linkListHandler = data.toListLinkHandler()
395395
396- val resp = ChannelTabInfo .getInfo(NewPipeExtractorInstance .extractor, linkListHandler)
397- val newNextPage = resp.nextPage?.toNextPageString()
396+ val (items, newNextPage) = if (nextPage == null ) {
397+ val resp = ChannelTabInfo .getInfo(NewPipeExtractorInstance .extractor, linkListHandler)
398+ resp.relatedItems to resp.nextPage
399+ } else {
400+ val resp = ChannelTabInfo .getMoreItems(
401+ NewPipeExtractorInstance .extractor,
402+ linkListHandler,
403+ nextPage.toPage()
404+ )
405+ resp.items to resp.nextPage
406+ }
398407
399- val items = resp.relatedItems
400- .mapNotNull { it.toContentItem() }
401- return ChannelTabResponse (items, newNextPage)
408+ return ChannelTabResponse (
409+ content = items.mapNotNull { it.toContentItem() },
410+ nextpage = newNextPage?.toNextPageString()
411+ )
402412 }
403413
404414 override suspend fun getChannelByName (channelName : String ): Channel {
You can’t perform that action at this time.
0 commit comments