Commit 4ee0104b authored by TobiGr's avatar TobiGr
Browse files

Various smaller improvements

parent 1e9240fd
......@@ -35,10 +35,7 @@ public class PeertubeSearchQueryHandlerFactory extends SearchQueryHandlerFactory
@Override
public String getUrl(String searchString, List<String> contentFilters, String sortFilter, String baseUrl) throws ParsingException {
try {
final String url = baseUrl + SEARCH_ENDPOINT
+ "?search=" + URLEncoder.encode(searchString, UTF_8);
return url;
return baseUrl + SEARCH_ENDPOINT + "?search=" + URLEncoder.encode(searchString, UTF_8);
} catch (UnsupportedEncodingException e) {
throw new ParsingException("Could not encode query", e);
}
......
......@@ -221,6 +221,7 @@ public class YoutubeService extends StreamingService {
return SUPPORTED_LANGUAGES;
}
@Override
public List<ContentCountry> getSupportedCountries() {
return SUPPORTED_COUNTRIES;
}
......
......@@ -154,11 +154,11 @@ public class StreamInfo extends Info {
// Lists can be null if a exception was thrown during extraction
if (streamInfo.getVideoStreams() == null)
streamInfo.setVideoStreams(new ArrayList<VideoStream>());
streamInfo.setVideoStreams(Collections.emptyList());
if (streamInfo.getVideoOnlyStreams() == null)
streamInfo.setVideoOnlyStreams(new ArrayList<VideoStream>());
streamInfo.setVideoOnlyStreams(Collections.emptyList());
if (streamInfo.getAudioStreams() == null)
streamInfo.setAudioStreams(new ArrayList<AudioStream>());
streamInfo.setAudioStreams(Collections.emptyList());
Exception dashMpdError = null;
if (!isNullOrEmpty(streamInfo.getDashMpdUrl())) {
......
......@@ -31,10 +31,10 @@ public class DonationLinkHelper {
public static AffiliateService getAffiliateServiceByLink(String link) throws MalformedURLException {
URL url = new URL(fixLink(link));
switch (url.getHost()) {
case "amzn.to": return AffiliateService.AMAZON;
default: return AffiliateService.NO_AFFILIATE;
if ("amzn.to".equals(url.getHost())) {
return AffiliateService.AMAZON;
}
return AffiliateService.NO_AFFILIATE;
}
private static String fixLink(String link) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment