mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-12 21:30:29 +05:30
Sort audio bitrates
When a user sets a resolution manually, the player seems to select the first matching track. Sort audio bitrates so that highest quality is first to avoid low quality audio.
This commit is contained in:
parent
32f8c9b6c4
commit
a5bd3a4485
@ -11,6 +11,7 @@ import org.schabi.newpipe.extractor.stream.StreamInfo;
|
||||
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 class CollectionUtils {
|
||||
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(),
|
||||
|
Loading…
Reference in New Issue
Block a user