[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 {
|
private void computeAnotherNextPageUrl() throws IOException, ExtractionException {
|
||||||
if (nextTrackIdsIndex >= nextTrackIds.size()) {
|
if (nextTrackIds == null || nextTrackIdsIndex >= nextTrackIds.size()) {
|
||||||
nextPageUrl = ""; // there are no more tracks
|
nextPageUrl = ""; // there are no more tracks
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,7 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor {
|
||||||
urlBuilder.append(","); // a , at the end is ok
|
urlBuilder.append(","); // a , at the end is ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nextTrackIdsIndex = upperIndex;
|
||||||
nextPageUrl = urlBuilder.toString();
|
nextPageUrl = urlBuilder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,13 @@ import org.junit.Test;
|
||||||
import org.schabi.newpipe.DownloaderTestImpl;
|
import org.schabi.newpipe.DownloaderTestImpl;
|
||||||
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.exceptions.ExtractionException;
|
||||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||||
import org.schabi.newpipe.extractor.services.BasePlaylistExtractorTest;
|
import org.schabi.newpipe.extractor.services.BasePlaylistExtractorTest;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||||
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
||||||
|
@ -70,7 +73,9 @@ public class SoundcloudPlaylistExtractorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMoreRelatedItems() {
|
public void testMoreRelatedItems() throws Exception {
|
||||||
|
defaultTestMoreItems(extractor);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
defaultTestMoreItems(extractor);
|
defaultTestMoreItems(extractor);
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
|
|
Loading…
Reference in New Issue