From a467f0cbd7019526ba96556823adc1ec4458e1de Mon Sep 17 00:00:00 2001 From: Ethan Pippin Date: Fri, 18 Mar 2022 22:05:08 -0600 Subject: [PATCH] lint --- .../MainCoordinator/iOSMainCoordinator.swift | 8 +- Shared/Singleton/SessionManager.swift | 8 +- .../SwiftfinNotificationCenter.swift | 100 ++++++------ Shared/ViewModels/HomeViewModel.swift | 4 +- .../ItemViewModel/ItemViewModel.swift | 6 +- Shared/ViewModels/ServerDetailViewModel.swift | 2 +- Shared/ViewModels/ServerListViewModel.swift | 2 +- Shared/ViewModels/UserListViewModel.swift | 4 +- .../VideoPlayerViewModel.swift | 2 +- Shared/Views/BlurHashView.swift | 91 +++++------ Shared/Views/ImageView.swift | 146 +++++++++--------- Shared/Views/InitialFailureView.swift | 34 ++-- Swiftfin tvOS/Views/LibraryListView.swift | 50 +++--- Swiftfin/AppURLHandler/AppURLHandler.swift | 2 +- Swiftfin/Components/PortraitHStackView.swift | 12 +- Swiftfin/Components/PortraitItemButton.swift | 12 +- .../VideoPlayer/VLCPlayerViewController.swift | 4 +- 17 files changed, 244 insertions(+), 243 deletions(-) diff --git a/Shared/Coordinators/MainCoordinator/iOSMainCoordinator.swift b/Shared/Coordinators/MainCoordinator/iOSMainCoordinator.swift index d1690c2f..7db2b6eb 100644 --- a/Shared/Coordinators/MainCoordinator/iOSMainCoordinator.swift +++ b/Shared/Coordinators/MainCoordinator/iOSMainCoordinator.swift @@ -45,10 +45,10 @@ final class MainCoordinator: NavigationCoordinatable { barAppearance.tintColor = UIColor(Color.jellyfinPurple) // Notification setup for state - Notifications[.didSignIn].subscribe(self, selector: #selector(didSignIn)) - Notifications[.didSignOut].subscribe(self, selector: #selector(didSignOut)) - Notifications[.processDeepLink].subscribe(self, selector: #selector(processDeepLink(_:))) - Notifications[.didChangeServerCurrentURI].subscribe(self, selector: #selector(didChangeServerCurrentURI(_:))) + Notifications[.didSignIn].subscribe(self, selector: #selector(didSignIn)) + Notifications[.didSignOut].subscribe(self, selector: #selector(didSignOut)) + Notifications[.processDeepLink].subscribe(self, selector: #selector(processDeepLink(_:))) + Notifications[.didChangeServerCurrentURI].subscribe(self, selector: #selector(didChangeServerCurrentURI(_:))) Defaults.publisher(.appAppearance) .sink { _ in diff --git a/Shared/Singleton/SessionManager.swift b/Shared/Singleton/SessionManager.swift index a6ddd435..2d3fffd2 100644 --- a/Shared/Singleton/SessionManager.swift +++ b/Shared/Singleton/SessionManager.swift @@ -240,7 +240,7 @@ final class SessionManager { Defaults[.lastServerUserID] = user.id currentLogin = (server: currentServer.state, user: currentUser.state) - Notifications[.didSignIn].post() + Notifications[.didSignIn].post() }) .map { _, user, _ in user.state @@ -255,7 +255,7 @@ final class SessionManager { Defaults[.lastServerUserID] = user.id setAuthHeader(with: user.accessToken) currentLogin = (server: server, user: user) - Notifications[.didSignIn].post() + Notifications[.didSignIn].post() } // MARK: logout @@ -265,7 +265,7 @@ final class SessionManager { JellyfinAPI.basePath = "" setAuthHeader(with: "") Defaults[.lastServerUserID] = nil - Notifications[.didSignOut].post() + Notifications[.didSignOut].post() } // MARK: purge @@ -278,7 +278,7 @@ final class SessionManager { delete(server: server) } - Notifications[.didPurge].post() + Notifications[.didPurge].post() } // MARK: delete user diff --git a/Shared/Singleton/SwiftfinNotificationCenter.swift b/Shared/Singleton/SwiftfinNotificationCenter.swift index 61fcfbc9..23ec8c4d 100644 --- a/Shared/Singleton/SwiftfinNotificationCenter.swift +++ b/Shared/Singleton/SwiftfinNotificationCenter.swift @@ -9,62 +9,62 @@ import Foundation class SwiftfinNotification { - - private let notificationName: Notification.Name - - fileprivate init(_ notificationName: Notification.Name) { - self.notificationName = notificationName - } - - func post(object: Any? = nil) { - Notifications.main.post(name: notificationName, object: object) - } - - func subscribe(_ observer: Any, selector: Selector) { - Notifications.main.addObserver(observer, selector: selector, name: notificationName, object: nil) - } - - func unsubscribe(_ observer: Any) { - Notifications.main.removeObserver(self, name: notificationName, object: nil) - } + + private let notificationName: Notification.Name + + fileprivate init(_ notificationName: Notification.Name) { + self.notificationName = notificationName + } + + func post(object: Any? = nil) { + Notifications.main.post(name: notificationName, object: object) + } + + func subscribe(_ observer: Any, selector: Selector) { + Notifications.main.addObserver(observer, selector: selector, name: notificationName, object: nil) + } + + func unsubscribe(_ observer: Any) { + Notifications.main.removeObserver(self, name: notificationName, object: nil) + } } enum Notifications { - - static let main: NotificationCenter = { - NotificationCenter() - }() - - final class Key { - public typealias NotificationKey = Notifications.Key - - public let key: String - public let underlyingNotification: SwiftfinNotification - public init(_ key: String) { - self.key = key - self.underlyingNotification = SwiftfinNotification(Notification.Name(key)) - } - } + static let main: NotificationCenter = { + NotificationCenter() + }() - static subscript(key: Key) -> SwiftfinNotification { - return key.underlyingNotification - } - - static func unsubscribe(_ observer: Any) { - main.removeObserver(observer) - } + final class Key { + public typealias NotificationKey = Notifications.Key + + public let key: String + public let underlyingNotification: SwiftfinNotification + + public init(_ key: String) { + self.key = key + self.underlyingNotification = SwiftfinNotification(Notification.Name(key)) + } + } + + static subscript(key: Key) -> SwiftfinNotification { + key.underlyingNotification + } + + static func unsubscribe(_ observer: Any) { + main.removeObserver(observer) + } } extension Notifications.Key { - - static let didSignIn = NotificationKey("didSignIn") - static let didSignOut = NotificationKey("didSignOut") - static let processDeepLink = NotificationKey("processDeepLink") - static let didPurge = NotificationKey("didPurge") - static let didChangeServerCurrentURI = NotificationKey("didChangeCurrentLoginURI") - static let toggleOfflineMode = NotificationKey("toggleOfflineMode") - static let didDeleteOfflineItem = NotificationKey("didDeleteOfflineItem") - static let didAddDownload = NotificationKey("didAddDownload") - static let didSendStopReport = NotificationKey("didSendStopReport") + + static let didSignIn = NotificationKey("didSignIn") + static let didSignOut = NotificationKey("didSignOut") + static let processDeepLink = NotificationKey("processDeepLink") + static let didPurge = NotificationKey("didPurge") + static let didChangeServerCurrentURI = NotificationKey("didChangeCurrentLoginURI") + static let toggleOfflineMode = NotificationKey("toggleOfflineMode") + static let didDeleteOfflineItem = NotificationKey("didDeleteOfflineItem") + static let didAddDownload = NotificationKey("didAddDownload") + static let didSendStopReport = NotificationKey("didSendStopReport") } diff --git a/Shared/ViewModels/HomeViewModel.swift b/Shared/ViewModels/HomeViewModel.swift index 7b93a9b0..3d4dccba 100644 --- a/Shared/ViewModels/HomeViewModel.swift +++ b/Shared/ViewModels/HomeViewModel.swift @@ -34,8 +34,8 @@ final class HomeViewModel: ViewModel { // Nov. 6, 2021 // This is a workaround since Stinsen doesn't have the ability to rebuild a root at the time of writing. // See ServerDetailViewModel.swift for feature request issue - Notifications[.didSignIn].subscribe(self, selector: #selector(didSignIn)) - Notifications[.didSignOut].subscribe(self, selector: #selector(didSignOut)) + Notifications[.didSignIn].subscribe(self, selector: #selector(didSignIn)) + Notifications[.didSignOut].subscribe(self, selector: #selector(didSignOut)) } @objc diff --git a/Shared/ViewModels/ItemViewModel/ItemViewModel.swift b/Shared/ViewModels/ItemViewModel/ItemViewModel.swift index 7d9b8c6c..b147763f 100644 --- a/Shared/ViewModels/ItemViewModel/ItemViewModel.swift +++ b/Shared/ViewModels/ItemViewModel/ItemViewModel.swift @@ -54,8 +54,8 @@ class ItemViewModel: ViewModel { super.init() getSimilarItems() - - Notifications[.didSendStopReport].subscribe(self, selector: #selector(receivedStopReport(_:))) + + Notifications[.didSendStopReport].subscribe(self, selector: #selector(receivedStopReport(_:))) refreshItemVideoPlayerViewModel(for: item) } @@ -69,7 +69,7 @@ class ItemViewModel: ViewModel { } else { // Remove if necessary. Note that this cannot be in deinit as // holding as an observer won't allow the object to be deinit-ed - Notifications.unsubscribe(self) + Notifications.unsubscribe(self) } } diff --git a/Shared/ViewModels/ServerDetailViewModel.swift b/Shared/ViewModels/ServerDetailViewModel.swift index 08030106..69d0ded3 100644 --- a/Shared/ViewModels/ServerDetailViewModel.swift +++ b/Shared/ViewModels/ServerDetailViewModel.swift @@ -25,7 +25,7 @@ class ServerDetailViewModel: ViewModel { } receiveValue: { newServerState in self.server = newServerState - Notifications[.didChangeServerCurrentURI].post(object: newServerState) + Notifications[.didChangeServerCurrentURI].post(object: newServerState) } .store(in: &cancellables) } diff --git a/Shared/ViewModels/ServerListViewModel.swift b/Shared/ViewModels/ServerListViewModel.swift index 7691e100..86b7cd59 100644 --- a/Shared/ViewModels/ServerListViewModel.swift +++ b/Shared/ViewModels/ServerListViewModel.swift @@ -20,7 +20,7 @@ class ServerListViewModel: ObservableObject { // This is a workaround since Stinsen doesn't have the ability to rebuild a root at the time of writing. // Feature request issue: https://github.com/rundfunk47/stinsen/issues/33 // Go to each MainCoordinator and implement the rebuild of the root when receiving the notification - Notifications[.didPurge].subscribe(self, selector: #selector(didPurge)) + Notifications[.didPurge].subscribe(self, selector: #selector(didPurge)) } func fetchServers() { diff --git a/Shared/ViewModels/UserListViewModel.swift b/Shared/ViewModels/UserListViewModel.swift index 258555da..7d087323 100644 --- a/Shared/ViewModels/UserListViewModel.swift +++ b/Shared/ViewModels/UserListViewModel.swift @@ -20,8 +20,8 @@ class UserListViewModel: ViewModel { self.server = server super.init() - - Notifications[.didChangeServerCurrentURI].subscribe(self, selector: #selector(didChangeCurrentLoginURI(_:))) + + Notifications[.didChangeServerCurrentURI].subscribe(self, selector: #selector(didChangeCurrentLoginURI(_:))) } @objc diff --git a/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift b/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift index 1325c0e6..738eeadc 100644 --- a/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift +++ b/Shared/ViewModels/VideoPlayerViewModel/VideoPlayerViewModel.swift @@ -585,7 +585,7 @@ extension VideoPlayerViewModel { self.handleAPIRequestError(completion: completion) } receiveValue: { _ in LogManager.shared.log.debug("Stop report sent for item: \(self.item.id ?? "No ID")") - Notifications[.didSendStopReport].post(object: self.item.id) + Notifications[.didSendStopReport].post(object: self.item.id) } .store(in: &cancellables) } diff --git a/Shared/Views/BlurHashView.swift b/Shared/Views/BlurHashView.swift index 9e8d3805..7eac6d5b 100644 --- a/Shared/Views/BlurHashView.swift +++ b/Shared/Views/BlurHashView.swift @@ -10,52 +10,53 @@ import SwiftUI import UIKit struct BlurHashView: UIViewRepresentable { - - let blurHash: String - - func makeUIView(context: Context) -> UIBlurHashView { - return UIBlurHashView(blurHash) - } - - func updateUIView(_ uiView: UIBlurHashView, context: Context) {} + + let blurHash: String + + func makeUIView(context: Context) -> UIBlurHashView { + UIBlurHashView(blurHash) + } + + func updateUIView(_ uiView: UIBlurHashView, context: Context) {} } class UIBlurHashView: UIView { - - private let imageView: UIImageView - - init(_ blurHash: String) { - let imageView = UIImageView() - imageView.translatesAutoresizingMaskIntoConstraints = false - self.imageView = imageView - - super.init(frame: .zero) - - computeBlurHashImageAsync(blurHash: blurHash) { blurImage in - DispatchQueue.main.async { - self.imageView.image = blurImage - self.imageView.setNeedsDisplay() - } - } - - addSubview(imageView) - - NSLayoutConstraint.activate([ - imageView.topAnchor.constraint(equalTo: topAnchor), - imageView.bottomAnchor.constraint(equalTo: bottomAnchor), - imageView.leftAnchor.constraint(equalTo: leftAnchor), - imageView.rightAnchor.constraint(equalTo: rightAnchor), - ]) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - private func computeBlurHashImageAsync(blurHash: String, _ completion: @escaping (UIImage?) -> Void) { - DispatchQueue.global(qos: .utility).async { - let image = UIImage(blurHash: blurHash, size: .Circle(radius: 12)) - completion(image) - } - } + + private let imageView: UIImageView + + init(_ blurHash: String) { + let imageView = UIImageView() + imageView.translatesAutoresizingMaskIntoConstraints = false + self.imageView = imageView + + super.init(frame: .zero) + + computeBlurHashImageAsync(blurHash: blurHash) { blurImage in + DispatchQueue.main.async { + self.imageView.image = blurImage + self.imageView.setNeedsDisplay() + } + } + + addSubview(imageView) + + NSLayoutConstraint.activate([ + imageView.topAnchor.constraint(equalTo: topAnchor), + imageView.bottomAnchor.constraint(equalTo: bottomAnchor), + imageView.leftAnchor.constraint(equalTo: leftAnchor), + imageView.rightAnchor.constraint(equalTo: rightAnchor), + ]) + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + private func computeBlurHashImageAsync(blurHash: String, _ completion: @escaping (UIImage?) -> Void) { + DispatchQueue.global(qos: .utility).async { + let image = UIImage(blurHash: blurHash, size: .Circle(radius: 12)) + completion(image) + } + } } diff --git a/Shared/Views/ImageView.swift b/Shared/Views/ImageView.swift index 1ef3f305..c932cd97 100644 --- a/Shared/Views/ImageView.swift +++ b/Shared/Views/ImageView.swift @@ -14,92 +14,92 @@ import UIKit // TODO: Fix 100+ inits struct ImageViewSource { - let url: URL? - let blurHash: String? - - init(url: URL? = nil, blurHash: String? = nil) { - self.url = url - self.blurHash = blurHash - } + let url: URL? + let blurHash: String? + + init(url: URL? = nil, blurHash: String? = nil) { + self.url = url + self.blurHash = blurHash + } } struct DefaultFailureView: View { - - var body: some View { - Color.secondary - } + + var body: some View { + Color.secondary + } } struct ImageView: View { - @State - private var sources: [ImageViewSource] - private var currentURL: URL? { sources.first?.url } - private var currentBlurHash: String? { sources.first?.blurHash } - private var failureView: FailureView - - init(_ source: URL?, blurHash: String? = nil, @ViewBuilder failureView: () -> FailureView) { - let imageViewSource = ImageViewSource(url: source, blurHash: blurHash) - _sources = State(initialValue: [imageViewSource]) - self.failureView = failureView() - } + @State + private var sources: [ImageViewSource] + private var currentURL: URL? { sources.first?.url } + private var currentBlurHash: String? { sources.first?.blurHash } + private var failureView: FailureView - init(_ source: ImageViewSource, @ViewBuilder failureView: () -> FailureView) { - _sources = State(initialValue: [source]) - self.failureView = failureView() - } + init(_ source: URL?, blurHash: String? = nil, @ViewBuilder failureView: () -> FailureView) { + let imageViewSource = ImageViewSource(url: source, blurHash: blurHash) + _sources = State(initialValue: [imageViewSource]) + self.failureView = failureView() + } - init(_ sources: [ImageViewSource], @ViewBuilder failureView: () -> FailureView) { - _sources = State(initialValue: sources) - self.failureView = failureView() - } + init(_ source: ImageViewSource, @ViewBuilder failureView: () -> FailureView) { + _sources = State(initialValue: [source]) + self.failureView = failureView() + } - @ViewBuilder - private var placeholderView: some View { - if let currentBlurHash = currentBlurHash { - BlurHashView(blurHash: currentBlurHash) - .id(currentBlurHash) - } else { - Color.secondary - } - } + init(_ sources: [ImageViewSource], @ViewBuilder failureView: () -> FailureView) { + _sources = State(initialValue: sources) + self.failureView = failureView() + } - var body: some View { - - if let currentURL = currentURL { - LazyImage(source: currentURL) { state in - if let image = state.image { - image - } else if state.error != nil { - placeholderView.onAppear { sources.removeFirst() } - } else { - placeholderView - } - } - .pipeline(ImagePipeline(configuration: .withDataCache)) - .id(currentURL) - } else { - failureView - } - } + @ViewBuilder + private var placeholderView: some View { + if let currentBlurHash = currentBlurHash { + BlurHashView(blurHash: currentBlurHash) + .id(currentBlurHash) + } else { + Color.secondary + } + } + + var body: some View { + + if let currentURL = currentURL { + LazyImage(source: currentURL) { state in + if let image = state.image { + image + } else if state.error != nil { + placeholderView.onAppear { sources.removeFirst() } + } else { + placeholderView + } + } + .pipeline(ImagePipeline(configuration: .withDataCache)) + .id(currentURL) + } else { + failureView + } + } } extension ImageView where FailureView == DefaultFailureView { - init(_ source: URL?, blurHash: String? = nil) { - let imageViewSource = ImageViewSource(url: source, blurHash: blurHash) - self.init(imageViewSource, failureView: { DefaultFailureView() }) - } - - init(_ source: ImageViewSource) { - self.init(source, failureView: { DefaultFailureView() }) - } + init(_ source: URL?, blurHash: String? = nil) { + let imageViewSource = ImageViewSource(url: source, blurHash: blurHash) + self.init(imageViewSource, failureView: { DefaultFailureView() }) + } - init(_ sources: [ImageViewSource]) { - self.init(sources, failureView: { DefaultFailureView() }) - } - - init(sources: [URL]) { - let imageViewSources = sources.compactMap { ImageViewSource(url: $0, blurHash: nil) } - self.init(imageViewSources, failureView: { DefaultFailureView() }) - } + init(_ source: ImageViewSource) { + self.init(source, failureView: { DefaultFailureView() }) + } + + init(_ sources: [ImageViewSource]) { + self.init(sources, failureView: { DefaultFailureView() }) + } + + init(sources: [URL]) { + let imageViewSources = sources.compactMap { ImageViewSource(url: $0, blurHash: nil) } + self.init(imageViewSources, failureView: { DefaultFailureView() }) + } } diff --git a/Shared/Views/InitialFailureView.swift b/Shared/Views/InitialFailureView.swift index 9af50ae6..8a9bed09 100644 --- a/Shared/Views/InitialFailureView.swift +++ b/Shared/Views/InitialFailureView.swift @@ -9,22 +9,22 @@ import SwiftUI struct InitialFailureView: View { - - let initials: String - - init(_ initials: String) { - self.initials = initials - } - - var body: some View { - ZStack { - Rectangle() - .foregroundColor(Color(UIColor.darkGray)) - Text(initials) - .font(.largeTitle) - .foregroundColor(.secondary) - .accessibilityHidden(true) - } - } + let initials: String + + init(_ initials: String) { + self.initials = initials + } + + var body: some View { + ZStack { + Rectangle() + .foregroundColor(Color(UIColor.darkGray)) + + Text(initials) + .font(.largeTitle) + .foregroundColor(.secondary) + .accessibilityHidden(true) + } + } } diff --git a/Swiftfin tvOS/Views/LibraryListView.swift b/Swiftfin tvOS/Views/LibraryListView.swift index 4760e74e..9001544d 100644 --- a/Swiftfin tvOS/Views/LibraryListView.swift +++ b/Swiftfin tvOS/Views/LibraryListView.swift @@ -38,6 +38,31 @@ struct LibraryListView: View { self.mainCoordinator.root(\.liveTV) } label: { + ZStack { + HStack { + Spacer() + VStack { + Text(library.name ?? "") + .foregroundColor(.white) + .font(.title2) + .fontWeight(.semibold) + } + Spacer() + }.padding(32) + } + .frame(minWidth: 100, maxWidth: .infinity) + .frame(height: 100) + } + .cornerRadius(10) + .shadow(radius: 5) + .padding(.bottom, 5) + } + } else { + Button { + self.libraryListRouter.route(to: \.library, + (viewModel: LibraryViewModel(parentID: library.id), title: library.name ?? "")) + } + label: { ZStack { HStack { Spacer() @@ -56,31 +81,6 @@ struct LibraryListView: View { .cornerRadius(10) .shadow(radius: 5) .padding(.bottom, 5) - } - } else { - Button { - self.libraryListRouter.route(to: \.library, - (viewModel: LibraryViewModel(parentID: library.id), title: library.name ?? "")) - } - label: { - ZStack { - HStack { - Spacer() - VStack { - Text(library.name ?? "") - .foregroundColor(.white) - .font(.title2) - .fontWeight(.semibold) - } - Spacer() - }.padding(32) - } - .frame(minWidth: 100, maxWidth: .infinity) - .frame(height: 100) - } - .cornerRadius(10) - .shadow(radius: 5) - .padding(.bottom, 5) } } } else { diff --git a/Swiftfin/AppURLHandler/AppURLHandler.swift b/Swiftfin/AppURLHandler/AppURLHandler.swift index 6c091372..7db83b2c 100644 --- a/Swiftfin/AppURLHandler/AppURLHandler.swift +++ b/Swiftfin/AppURLHandler/AppURLHandler.swift @@ -81,7 +81,7 @@ extension AppURLHandler { // It would be nice if the ItemViewModel could be initialized to id later. getItem(userID: userID, itemID: itemID) { item in guard let item = item else { return } - Notifications[.processDeepLink].post(object: DeepLink.item(item)) + Notifications[.processDeepLink].post(object: DeepLink.item(item)) } return true diff --git a/Swiftfin/Components/PortraitHStackView.swift b/Swiftfin/Components/PortraitHStackView.swift index e0f76706..a9aa57c0 100644 --- a/Swiftfin/Components/PortraitHStackView.swift +++ b/Swiftfin/Components/PortraitHStackView.swift @@ -45,12 +45,12 @@ struct PortraitImageHStackView: View { VStack(alignment: horizontalAlignment) { ImageView(item.imageURLConstructor(maxWidth: Int(maxWidth)), blurHash: item.blurHash, - failureView: { - InitialFailureView(item.failureInitials) - }) - .portraitPoster(width: maxWidth) - .shadow(radius: 4, y: 2) - .accessibilityIgnoresInvertColors() + failureView: { + InitialFailureView(item.failureInitials) + }) + .portraitPoster(width: maxWidth) + .shadow(radius: 4, y: 2) + .accessibilityIgnoresInvertColors() if item.showTitle { Text(item.title) diff --git a/Swiftfin/Views/VideoPlayer/VLCPlayerViewController.swift b/Swiftfin/Views/VideoPlayer/VLCPlayerViewController.swift index 9407d2b2..6f7e2173 100644 --- a/Swiftfin/Views/VideoPlayer/VLCPlayerViewController.swift +++ b/Swiftfin/Views/VideoPlayer/VLCPlayerViewController.swift @@ -755,7 +755,7 @@ extension VLCPlayerViewController { extension VLCPlayerViewController: VLCMediaPlayerDelegate { // MARK: mediaPlayerStateChanged - func mediaPlayerStateChanged(_ aNotification: Notification) { + func mediaPlayerStateChanged(_ aNotification: Notification) { // Don't show buffering if paused, usually here while scrubbing if vlcMediaPlayer.state == .buffering, viewModel.playerState == .paused { return @@ -774,7 +774,7 @@ extension VLCPlayerViewController: VLCMediaPlayerDelegate { // MARK: mediaPlayerTimeChanged - func mediaPlayerTimeChanged(_ aNotification: Notification) { + func mediaPlayerTimeChanged(_ aNotification: Notification) { if !viewModel.sliderIsScrubbing { viewModel.sliderPercentage = Double(vlcMediaPlayer.position) }