mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 07:50:34 +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 -> {
|
||||
// Channel URL from second entry
|
||||
final String channelUrl = values[1].replace("http://", "https://");
|
||||
if (!channelUrl.startsWith(BASE_CHANNEL_URL)) {
|
||||
return null;
|
||||
} else {
|
||||
// Channel title from third entry
|
||||
final String title = values[2];
|
||||
return new SubscriptionItem(service.getServiceId(), channelUrl, title);
|
||||
}
|
||||
return channelUrl.startsWith(BASE_CHANNEL_URL)
|
||||
? new SubscriptionItem(
|
||||
service.getServiceId(),
|
||||
channelUrl,
|
||||
values[2]) // Channel title from third entry
|
||||
: null;
|
||||
})
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
|
Loading…
x
Reference in New Issue
Block a user