This commit is contained in:
Arkadiusz Fal 2023-07-24 19:09:56 +02:00
parent 44045b9e19
commit 58ba6f5fe7

View File

@ -620,6 +620,10 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
.dictionaryValue["audioStreams"]? .dictionaryValue["audioStreams"]?
.arrayValue .arrayValue
.filter { $0.dictionaryValue["format"]?.string == "M4A" } .filter { $0.dictionaryValue["format"]?.string == "M4A" }
.filter { stream in
let type = stream.dictionaryValue["audioTrackType"]?.string
return type == nil || type == "ORIGINAL"
}
.sorted { .sorted {
$0.dictionaryValue["bitrate"]?.int ?? 0 > $0.dictionaryValue["bitrate"]?.int ?? 0 >
$1.dictionaryValue["bitrate"]?.int ?? 0 $1.dictionaryValue["bitrate"]?.int ?? 0