Smaller code improvements
This commit is contained in:
parent
8fbd1a2bcf
commit
657b00ca11
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.schabi.newpipe.extractor.utils.ExtractorHelper;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -153,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())) {
|
||||
|
|
Loading…
Reference in New Issue