Remove misleading first "Non" from getNonUrlAndNonTorrentStreams

This commit is contained in:
Stypox 2022-06-18 18:52:32 +02:00
parent 2019af831a
commit 4e87f5aabc
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
4 changed files with 10 additions and 10 deletions

View File

@ -123,7 +123,7 @@ import static org.schabi.newpipe.player.helper.PlayerHelper.globalScreenOrientat
import static org.schabi.newpipe.player.helper.PlayerHelper.isClearingQueueConfirmationRequired; import static org.schabi.newpipe.player.helper.PlayerHelper.isClearingQueueConfirmationRequired;
import static org.schabi.newpipe.player.playqueue.PlayQueueItem.RECOVERY_UNSET; import static org.schabi.newpipe.player.playqueue.PlayQueueItem.RECOVERY_UNSET;
import static org.schabi.newpipe.util.ExtractorHelper.showMetaInfoInTextView; import static org.schabi.newpipe.util.ExtractorHelper.showMetaInfoInTextView;
import static org.schabi.newpipe.util.ListHelper.getNonUrlAndNonTorrentStreams; import static org.schabi.newpipe.util.ListHelper.getUrlAndNonTorrentStreams;
public final class VideoDetailFragment public final class VideoDetailFragment
extends BaseStateFragment<StreamInfo> extends BaseStateFragment<StreamInfo>
@ -1107,7 +1107,7 @@ public final class VideoDetailFragment
if (!useExternalAudioPlayer) { if (!useExternalAudioPlayer) {
openNormalBackgroundPlayer(append); openNormalBackgroundPlayer(append);
} else { } else {
final List<AudioStream> audioStreams = getNonUrlAndNonTorrentStreams( final List<AudioStream> audioStreams = getUrlAndNonTorrentStreams(
currentInfo.getAudioStreams()); currentInfo.getAudioStreams());
final int index = ListHelper.getDefaultAudioFormat(activity, audioStreams); final int index = ListHelper.getDefaultAudioFormat(activity, audioStreams);
@ -2157,8 +2157,8 @@ public final class VideoDetailFragment
final List<VideoStream> videoStreamsForExternalPlayers = final List<VideoStream> videoStreamsForExternalPlayers =
ListHelper.getSortedStreamVideosList( ListHelper.getSortedStreamVideosList(
activity, activity,
getNonUrlAndNonTorrentStreams(currentInfo.getVideoStreams()), getUrlAndNonTorrentStreams(currentInfo.getVideoStreams()),
getNonUrlAndNonTorrentStreams(currentInfo.getVideoOnlyStreams()), getUrlAndNonTorrentStreams(currentInfo.getVideoOnlyStreams()),
false, false,
false false
); );

View File

@ -28,7 +28,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import static com.google.android.exoplayer2.C.TIME_UNSET; import static com.google.android.exoplayer2.C.TIME_UNSET;
import static org.schabi.newpipe.util.ListHelper.getNonUrlAndNonTorrentStreams; import static org.schabi.newpipe.util.ListHelper.getUrlAndNonTorrentStreams;
import static org.schabi.newpipe.util.ListHelper.getNonTorrentStreams; import static org.schabi.newpipe.util.ListHelper.getNonTorrentStreams;
public class VideoPlaybackResolver implements PlaybackResolver { public class VideoPlaybackResolver implements PlaybackResolver {
@ -131,7 +131,7 @@ public class VideoPlaybackResolver implements PlaybackResolver {
final List<SubtitlesStream> subtitlesStreams = info.getSubtitles(); final List<SubtitlesStream> subtitlesStreams = info.getSubtitles();
if (subtitlesStreams != null) { if (subtitlesStreams != null) {
// Torrent and non URL subtitles are not supported by ExoPlayer // Torrent and non URL subtitles are not supported by ExoPlayer
final List<SubtitlesStream> nonTorrentAndUrlStreams = getNonUrlAndNonTorrentStreams( final List<SubtitlesStream> nonTorrentAndUrlStreams = getUrlAndNonTorrentStreams(
subtitlesStreams); subtitlesStreams);
for (final SubtitlesStream subtitle : nonTorrentAndUrlStreams) { for (final SubtitlesStream subtitle : nonTorrentAndUrlStreams) {
final MediaFormat mediaFormat = subtitle.getFormat(); final MediaFormat mediaFormat = subtitle.getFormat();

View File

@ -137,7 +137,7 @@ public final class ListHelper {
* @return a stream list which only contains URL streams and non-torrent streams * @return a stream list which only contains URL streams and non-torrent streams
*/ */
@NonNull @NonNull
public static <S extends Stream> List<S> getNonUrlAndNonTorrentStreams( public static <S extends Stream> List<S> getUrlAndNonTorrentStreams(
final List<S> streamList) { final List<S> streamList) {
return getFilteredStreamList(streamList, return getFilteredStreamList(streamList,
stream -> stream.isUrl() && stream.getDeliveryMethod() != DeliveryMethod.TORRENT); stream -> stream.isUrl() && stream.getDeliveryMethod() != DeliveryMethod.TORRENT);

View File

@ -63,7 +63,7 @@ import org.schabi.newpipe.util.external_communication.ShareUtils;
import java.util.List; import java.util.List;
import static org.schabi.newpipe.util.ListHelper.getNonUrlAndNonTorrentStreams; import static org.schabi.newpipe.util.ListHelper.getUrlAndNonTorrentStreams;
public final class NavigationHelper { public final class NavigationHelper {
public static final String MAIN_FRAGMENT_TAG = "main_fragment_tag"; public static final String MAIN_FRAGMENT_TAG = "main_fragment_tag";
@ -227,7 +227,7 @@ public final class NavigationHelper {
} }
final List<AudioStream> audioStreamsForExternalPlayers = final List<AudioStream> audioStreamsForExternalPlayers =
getNonUrlAndNonTorrentStreams(audioStreams); getUrlAndNonTorrentStreams(audioStreams);
if (audioStreamsForExternalPlayers.isEmpty()) { if (audioStreamsForExternalPlayers.isEmpty()) {
Toast.makeText(context, R.string.no_audio_streams_available_for_external_players, Toast.makeText(context, R.string.no_audio_streams_available_for_external_players,
Toast.LENGTH_SHORT).show(); Toast.LENGTH_SHORT).show();
@ -250,7 +250,7 @@ public final class NavigationHelper {
final List<VideoStream> videoStreamsForExternalPlayers = final List<VideoStream> videoStreamsForExternalPlayers =
ListHelper.getSortedStreamVideosList(context, ListHelper.getSortedStreamVideosList(context,
getNonUrlAndNonTorrentStreams(videoStreams), null, false, false); getUrlAndNonTorrentStreams(videoStreams), null, false, false);
if (videoStreamsForExternalPlayers.isEmpty()) { if (videoStreamsForExternalPlayers.isEmpty()) {
Toast.makeText(context, R.string.no_video_streams_available_for_external_players, Toast.makeText(context, R.string.no_video_streams_available_for_external_players,
Toast.LENGTH_SHORT).show(); Toast.LENGTH_SHORT).show();