diff --git a/src/main/java/me/kavin/piped/utils/CollectionUtils.java b/src/main/java/me/kavin/piped/utils/CollectionUtils.java index f2b43997..a36d79cf 100644 --- a/src/main/java/me/kavin/piped/utils/CollectionUtils.java +++ b/src/main/java/me/kavin/piped/utils/CollectionUtils.java @@ -11,6 +11,7 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamType; +import java.util.Comparator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -74,6 +75,8 @@ public static Streams collectStreamInfo(StreamInfo info) { metaInfoItem.getUrls(), metaInfoItem.getUrlTexts() ))); + audioStreams.sort(Comparator.comparingInt((PipedStream stream) -> stream.bitrate).reversed()); + return new Streams(info.getName(), info.getDescription().getContent(), info.getTextualUploadDate(), info.getUploaderName(), substringYouTube(info.getUploaderUrl()), getLastThumbnail(info.getUploaderAvatars()), getLastThumbnail(info.getThumbnails()), info.getDuration(),