From 0268798bcc67057eb45d0f7c7f890be4de403e01 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 17 Jun 2022 15:13:56 +0200 Subject: [PATCH] Fix extracting FPS --- Model/Applications/PipedAPI.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Applications/PipedAPI.swift b/Model/Applications/PipedAPI.swift index ada60ef7..a4980331 100644 --- a/Model/Applications/PipedAPI.swift +++ b/Model/Applications/PipedAPI.swift @@ -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