1
0
mirror of https://github.com/yattee/yattee.git synced 2025-01-10 11:30:32 +05:30

Fix extracting FPS

This commit is contained in:
Arkadiusz Fal 2022-06-17 15:13:56 +02:00
parent 4e2dc1f199
commit bc47a2958f

View File

@ -512,7 +512,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
let videoOnly = videoStream.dictionaryValue["videoOnly"]?.boolValue ?? true
let quality = videoStream.dictionaryValue["quality"]?.string ?? "unknown"
let qualityComponents = quality.components(separatedBy: "p")
let fps = Int(qualityComponents[1].isEmpty ? "30" : qualityComponents[1])
let fps = qualityComponents.count > 1 ? Int(qualityComponents[1]) : 30
let resolution = Stream.Resolution.from(resolution: quality, fps: fps)
let videoFormat = videoStream.dictionaryValue["format"]?.stringValue