Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert java 9 usage with java 8 equivalent #40

Merged
merged 4 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.schabi.newpipe.extractor.services.soundcloud.SoundcloudService;
import org.schabi.newpipe.extractor.services.youtube.YoutubeService;

import java.util.Arrays;
import java.util.List;

/*
Expand Down Expand Up @@ -45,7 +46,7 @@ private ServiceList() {
* When creating a new service, put this service in the end of this list,
* and give it the next free id.
*/
private static final List<StreamingService> SERVICES = List.of(
private static final List<StreamingService> SERVICES = Arrays.asList(
YouTube, SoundCloud, MediaCCC, PeerTube, Bandcamp);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.schabi.newpipe.extractor.utils.JsonUtils;

import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

Expand Down Expand Up @@ -67,7 +68,7 @@ public InfoItemsPage<CommentsInfoItem> getInitialPage()

final String trackId = getTrackId();
final String token = getNextPageToken(reviews);
return new InfoItemsPage<>(collector, new Page(List.of(trackId, token)));
return new InfoItemsPage<>(collector, new Page(Arrays.asList(trackId, token)));
}

@Override
Expand All @@ -92,7 +93,7 @@ public InfoItemsPage<CommentsInfoItem> getPage(final Page page)
}

return new InfoItemsPage<>(collector,
new Page(List.of(trackId, getNextPageToken(reviews))));
new Page(Arrays.asList(trackId, getNextPageToken(reviews))));
}

private JsonObject fetchReviewsData(final String trackId, final String token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public List<String> suggestionList(final String query) throws IOException, Extra
.map(JsonArray.class::cast)
.map(suggestion -> suggestion.getString(0)) // 0 is the search suggestion
.filter(suggestion -> !isBlank(suggestion)) // Filter blank suggestions
.collect(Collectors.toUnmodifiableList());
.collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));
} catch (final JsonParserException e) {
throw new ParsingException("Could not parse JSON response", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public InfoItemsPage<StreamInfoItem> getInitialPage() throws ParsingException {
final Stream<JsonObject> items;
if (isVideoTab) {
// The first shelf of the Videos tab contains the normal trends
items = shelves.findFirst().stream();
items = shelves.findFirst().isPresent() ? Stream.of(shelves.findFirst().get()) : Stream.empty();
} else {
// Filter Trending shorts and Recently trending sections which have a title,
// contrary to normal trends
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.PaidContentException;
import org.schabi.newpipe.extractor.stream.StreamExtractor;

public class BandcampPaidStreamExtractorTest {

Expand All @@ -19,7 +20,7 @@ public static void setUp() {

@Test
public void testPaidTrack() throws ExtractionException {
final var extractor = Bandcamp.getStreamExtractor("https://radicaldreamland.bandcamp.com/track/hackmud-continuous-mix");
final StreamExtractor extractor = Bandcamp.getStreamExtractor("https://radicaldreamland.bandcamp.com/track/hackmud-continuous-mix");
assertThrows(PaidContentException.class, extractor::fetchPage);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ public static void setUp() throws Exception {
"",
new Description("Arte is a French/German public broadcast service.",
Description.PLAIN_TEXT),
List.of(new URL(
Collections.singletonList(new URL(
"https://en.wikipedia.org/wiki/Arte?wprov=yicw1")),
List.of("Wikipedia")
Collections.singletonList("Wikipedia")
));
}
@Override public boolean expectedUploaderVerified() { return true; }
Expand Down
Loading