mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-29 00:10:35 +05:30
Polish: Use ternary instead of if
This commit is contained in:
parent
625e9f96d2
commit
222d869efc
@ -149,13 +149,12 @@ public class YoutubeSubscriptionExtractor extends SubscriptionExtractor {
|
|||||||
.map(values -> {
|
.map(values -> {
|
||||||
// Channel URL from second entry
|
// Channel URL from second entry
|
||||||
final String channelUrl = values[1].replace("http://", "https://");
|
final String channelUrl = values[1].replace("http://", "https://");
|
||||||
if (!channelUrl.startsWith(BASE_CHANNEL_URL)) {
|
return channelUrl.startsWith(BASE_CHANNEL_URL)
|
||||||
return null;
|
? new SubscriptionItem(
|
||||||
} else {
|
service.getServiceId(),
|
||||||
// Channel title from third entry
|
channelUrl,
|
||||||
final String title = values[2];
|
values[2]) // Channel title from third entry
|
||||||
return new SubscriptionItem(service.getServiceId(), channelUrl, title);
|
: null;
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toUnmodifiableList());
|
.collect(Collectors.toUnmodifiableList());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user