mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-14 06:10:33 +05:30
[SoundCloud] Fix playlist next page generation
This commit is contained in:
parent
ca8bf53b61
commit
1558da6f6b
@ -145,7 +145,7 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
|
||||
}
|
||||
|
||||
private void computeAnotherNextPageUrl() throws IOException, ExtractionException {
|
||||
if (nextTrackIdsIndex >= nextTrackIds.size()) {
|
||||
if (nextTrackIds == null || nextTrackIdsIndex >= nextTrackIds.size()) {
|
||||
nextPageUrl = ""; // there are no more tracks
|
||||
return;
|
||||
}
|
||||
@ -160,6 +160,7 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
|
||||
urlBuilder.append(","); // a , at the end is ok
|
||||
}
|
||||
|
||||
nextTrackIdsIndex = upperIndex;
|
||||
nextPageUrl = urlBuilder.toString();
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,13 @@ import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||
import org.schabi.newpipe.extractor.services.BasePlaylistExtractorTest;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
||||
@ -70,7 +73,9 @@ public class SoundcloudPlaylistExtractorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMoreRelatedItems() {
|
||||
public void testMoreRelatedItems() throws Exception {
|
||||
defaultTestMoreItems(extractor);
|
||||
|
||||
try {
|
||||
defaultTestMoreItems(extractor);
|
||||
} catch (Throwable ignored) {
|
||||
|
Loading…
Reference in New Issue
Block a user