diff --git a/Model/Accounts/InstancesModel.swift b/Model/Accounts/InstancesModel.swift index bf436c6c..fc0d18f8 100644 --- a/Model/Accounts/InstancesModel.swift +++ b/Model/Accounts/InstancesModel.swift @@ -53,7 +53,7 @@ final class InstancesModel: ObservableObject { } static func remove(_ instance: Instance) { - let accounts = InstancesModel.accounts(instance.id) + let accounts = Self.accounts(instance.id) if let index = Defaults[.instances].firstIndex(where: { $0.id == instance.id }) { Defaults[.instances].remove(at: index) accounts.forEach { AccountsModel.remove($0) } diff --git a/Model/Applications/InvidiousAPI.swift b/Model/Applications/InvidiousAPI.swift index 34db34e6..5a5d86fb 100644 --- a/Model/Applications/InvidiousAPI.swift +++ b/Model/Applications/InvidiousAPI.swift @@ -160,11 +160,11 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI { } private func pathPattern(_ path: String) -> String { - "**\(InvidiousAPI.basePath)/\(path)" + "**\(Self.basePath)/\(path)" } private func basePathAppending(_ path: String) -> String { - "\(InvidiousAPI.basePath)/\(path)" + "\(Self.basePath)/\(path)" } private var cookieHeader: String { @@ -172,11 +172,11 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI { } var popular: Resource? { - resource(baseURL: account.url, path: "\(InvidiousAPI.basePath)/popular") + resource(baseURL: account.url, path: "\(Self.basePath)/popular") } func trending(country: Country, category: TrendingCategory?) -> Resource { - resource(baseURL: account.url, path: "\(InvidiousAPI.basePath)/trending") + resource(baseURL: account.url, path: "\(Self.basePath)/trending") .withParam("type", category?.name) .withParam("region", country.rawValue) } @@ -186,7 +186,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI { } var feed: Resource? { - resource(baseURL: account.url, path: "\(InvidiousAPI.basePath)/auth/feed") + resource(baseURL: account.url, path: "\(Self.basePath)/auth/feed") } var subscriptions: Resource? { diff --git a/Model/SponsorBlock/SponsorBlockAPI.swift b/Model/SponsorBlock/SponsorBlockAPI.swift index aafe1e15..3a514587 100644 --- a/Model/SponsorBlock/SponsorBlockAPI.swift +++ b/Model/SponsorBlock/SponsorBlockAPI.swift @@ -13,7 +13,7 @@ final class SponsorBlockAPI: ObservableObject { @Published var segments = [Segment]() static func categoryDescription(_ name: String) -> String? { - guard SponsorBlockAPI.categories.contains(name) else { + guard Self.categories.contains(name) else { return nil } @@ -30,7 +30,7 @@ final class SponsorBlockAPI: ObservableObject { } static func categoryDetails(_ name: String) -> String? { - guard SponsorBlockAPI.categories.contains(name) else { + guard Self.categories.contains(name) else { return nil } diff --git a/Shared/Player/VideoDetailsPaddingModifier.swift b/Shared/Player/VideoDetailsPaddingModifier.swift index f2737bde..08fc30e4 100644 --- a/Shared/Player/VideoDetailsPaddingModifier.swift +++ b/Shared/Player/VideoDetailsPaddingModifier.swift @@ -26,7 +26,7 @@ struct VideoDetailsPaddingModifier: ViewModifier { self.geometry = geometry self.aspectRatio = aspectRatio ?? VideoPlayerView.defaultAspectRatio self.minimumHeightLeft = minimumHeightLeft ?? VideoPlayerView.defaultMinimumHeightLeft - self.additionalPadding = additionalPadding ?? VideoDetailsPaddingModifier.defaultAdditionalDetailsPadding + self.additionalPadding = additionalPadding ?? Self.defaultAdditionalDetailsPadding self.fullScreen = fullScreen } diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index 8f125907..3966920c 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -274,7 +274,7 @@ struct VideoPlayerView: View { Spacer() } .contentShape(Rectangle()) - .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: geometry.size.width / VideoPlayerView.defaultAspectRatio) + .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: geometry.size.width / Self.defaultAspectRatio) } func pictureInPicturePlaceholder(geometry: GeometryProxy) -> some View { @@ -303,7 +303,7 @@ struct VideoPlayerView: View { } } .contentShape(Rectangle()) - .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: geometry.size.width / VideoPlayerView.defaultAspectRatio) + .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: geometry.size.width / Self.defaultAspectRatio) } var sidebarQueue: Bool { diff --git a/Shared/Trending/TrendingCountry.swift b/Shared/Trending/TrendingCountry.swift index 3e51835d..ca5f213d 100644 --- a/Shared/Trending/TrendingCountry.swift +++ b/Shared/Trending/TrendingCountry.swift @@ -16,9 +16,9 @@ struct TrendingCountry: View { #if !os(tvOS) HStack { if #available(iOS 15.0, macOS 12.0, *) { - TextField("Country", text: $query, prompt: Text(TrendingCountry.prompt)) + TextField("Country", text: $query, prompt: Text(Self.prompt)) } else { - TextField(TrendingCountry.prompt, text: $query) + TextField(Self.prompt, text: $query) } Button("Done") { selectCountryAndDismiss() } @@ -30,7 +30,7 @@ struct TrendingCountry: View { countriesList } #if os(tvOS) - .searchable(text: $query, placement: .automatic, prompt: Text(TrendingCountry.prompt)) + .searchable(text: $query, placement: .automatic, prompt: Text(Self.prompt)) .background(Color.black) #endif } diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index b4d5f793..70f1c86d 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -11,7 +11,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate { } func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { // swiftlint:disable:this discouraged_optional_collection - AppDelegate.instance = self + Self.instance = self return true } }