diff --git a/Model/Applications/VideosAPI.swift b/Model/Applications/VideosAPI.swift index d4c4b9d6..ec20479f 100644 --- a/Model/Applications/VideosAPI.swift +++ b/Model/Applications/VideosAPI.swift @@ -80,16 +80,18 @@ extension VideosAPI { return } - video(item.videoID).load().onSuccess { response in - guard let video: Video = response.typedContent() else { - return + video(item.videoID).load() + .onSuccess { response in + guard let video: Video = response.typedContent() else { + return + } + + var newItem = item + newItem.video = video + + completionHandler(newItem) } - - var newItem = item - newItem.video = video - - completionHandler(newItem) - }.onFailure { failureHandler?($0) } + .onFailure { failureHandler?($0) } } func shareURL(_ item: ContentItem, frontendHost: String? = nil, time: CMTime? = nil) -> URL? { diff --git a/Model/SettingsModel.swift b/Model/SettingsModel.swift index 47bf3a24..f0549069 100644 --- a/Model/SettingsModel.swift +++ b/Model/SettingsModel.swift @@ -1,7 +1,7 @@ import Foundation import SwiftUI -class SettingsModel: ObservableObject { +final class SettingsModel: ObservableObject { @Published var presentingAlert = false @Published var alert = Alert(title: Text("Error")) diff --git a/Shared/Player/Controls/ControlsOverlay.swift b/Shared/Player/Controls/ControlsOverlay.swift index 589b68f4..6ce4cb51 100644 --- a/Shared/Player/Controls/ControlsOverlay.swift +++ b/Shared/Player/Controls/ControlsOverlay.swift @@ -136,7 +136,7 @@ struct ControlsOverlay: View { captionsPicker .labelsHidden() .frame(maxWidth: 300) - #else + #elseif os(iOS) Menu { captionsPicker .frame(width: 140, height: 30) diff --git a/Shared/Settings/LocationsSettings.swift b/Shared/Settings/LocationsSettings.swift index 3eaa73d6..5d647727 100644 --- a/Shared/Settings/LocationsSettings.swift +++ b/Shared/Settings/LocationsSettings.swift @@ -96,7 +96,8 @@ struct LocationsSettings: View { if let instances: [ManifestedInstance] = response.typedContent() { self.countries = instances.map(\.country).unique().sorted() } - }.onFailure { _ in + } + .onFailure { _ in model.presentAlert(title: "Could not load locations manifest") } }