Merge pull request #75 from jellyfin/create-pull-request/patch

[ci] SwiftLint
This commit is contained in:
aiden vigue 2021-06-18 21:49:37 -04:00 committed by GitHub
commit e5b41b8917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 17 deletions

View File

@ -141,7 +141,7 @@ extension View {
@main
struct JellyfinPlayerApp: App {
let persistenceController = PersistenceController.shared
var body: some Scene {
WindowGroup {
SplashView()

View File

@ -186,7 +186,7 @@ struct MovieItemView: View {
Text("Studios:").font(.callout).fontWeight(.semibold)
ForEach(viewModel.item.studios!, id: \.id) { studio in
NavigationLink(destination: LazyView {
LibraryView(viewModel: .init(studio: studio), title: studio.name ?? "")
}) {
Text(studio.name ?? "").font(.footnote)

View File

@ -51,7 +51,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
@IBOutlet weak var jumpForwardButton: UIButton!
@IBOutlet weak var playerSettingsButton: UIButton!
@IBOutlet weak var castButton: UIButton!
var shouldShowLoadingScreen: Bool = false
var ssTargetValueOffset: Int = 0
var ssStartValue: Int = 0
@ -173,11 +173,11 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
self.mainActionButton.setImage(UIImage(systemName: "play"), for: .normal)
}
}
@IBAction func castButtonPressed(_ sender: Any) {
}
func settingsPopoverDismissed() {
optionsVC?.dismiss(animated: true, completion: nil)
self.mediaPlayer.play()
@ -278,24 +278,24 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
UIDevice.current.setValue(value, forKey: "orientation")
}
}
func mediaHasStartedPlaying() {
let scanner = CastDeviceScanner()
NotificationCenter.default.addObserver(forName: CastDeviceScanner.deviceListDidChange, object: scanner, queue: nil) { _ in
dump(scanner.devices)
if(!scanner.devices.isEmpty) {
self.castButton.isEnabled = true;
if !scanner.devices.isEmpty {
self.castButton.isEnabled = true
self.castButton.setImage(UIImage(named: "CastDisconnected"), for: .normal)
} else {
self.castButton.isEnabled = false;
self.castButton.isEnabled = false
self.castButton.setImage(nil, for: .normal)
}
}
scanner.startScanning()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
overrideUserInterfaceStyle = .dark

View File

@ -12,7 +12,7 @@ private struct MultiSelectionView<Selectable: Hashable>: View {
let optionToString: (Selectable) -> String
let label: String
@Binding var selected: Array<Selectable>
@Binding var selected: [Selectable]
var body: some View {
List {
@ -44,7 +44,7 @@ struct MultiSelector<Selectable: Hashable>: View {
let options: [Selectable]
let optionToString: (Selectable) -> String
var selected: Binding<Array<Selectable>>
var selected: Binding<[Selectable]>
private var formattedSelectedListString: String {
ListFormatter.localizedString(byJoining: selected.wrappedValue.map { optionToString($0) })

View File

@ -20,7 +20,7 @@ final class LatestMediaViewModel: ViewModel {
init(libraryID: String) {
self.libraryID = libraryID
super.init()
requestLatestMedia()
}
@ -32,7 +32,7 @@ final class LatestMediaViewModel: ViewModel {
.seasonUserData,
.overview,
.genres,
.people,
.people
],
enableUserData: true, limit: 12)
.trackActivity(loading)

View File

@ -45,8 +45,7 @@ final class LibraryViewModel: ViewModel {
person: BaseItemPerson? = nil,
genre: NameGuidPair? = nil,
studio: NameGuidPair? = nil,
filters: LibraryFilters = LibraryFilters(filters: [], sortOrder: [.ascending], withGenres: [], sortBy: [.name]))
{
filters: LibraryFilters = LibraryFilters(filters: [], sortOrder: [.ascending], withGenres: [], sortBy: [.name])) {
self.parentID = parentID
self.person = person
self.genre = genre