fix tvos
This commit is contained in:
parent
a467f0cbd7
commit
9441de86a8
|
@ -40,19 +40,18 @@ final class MainCoordinator: NavigationCoordinatable {
|
|||
DataLoader.sharedUrlCache.diskCapacity = 1000 * 1024 * 1024 // 1000MB disk
|
||||
|
||||
// Notification setup for state
|
||||
let nc = SwiftfinNotificationCenter.main
|
||||
nc.addObserver(self, selector: #selector(didLogIn), name: SwiftfinNotificationCenter.Keys.didSignIn, object: nil)
|
||||
nc.addObserver(self, selector: #selector(didLogOut), name: SwiftfinNotificationCenter.Keys.didSignOut, object: nil)
|
||||
Notifications[.didSignIn].subscribe(self, selector: #selector(didSignIn))
|
||||
Notifications[.didSignOut].subscribe(self, selector: #selector(didSignOut))
|
||||
}
|
||||
|
||||
@objc
|
||||
func didLogIn() {
|
||||
func didSignIn() {
|
||||
LogManager.shared.log.info("Received `didSignIn` from NSNotificationCenter.")
|
||||
root(\.mainTab)
|
||||
}
|
||||
|
||||
@objc
|
||||
func didLogOut() {
|
||||
func didSignOut() {
|
||||
LogManager.shared.log.info("Received `didSignOut` from NSNotificationCenter.")
|
||||
root(\.serverList)
|
||||
}
|
||||
|
|
|
@ -30,11 +30,10 @@ struct CinematicNextUpCardView: View {
|
|||
])
|
||||
.frame(width: 350, height: 210)
|
||||
} else {
|
||||
ImageView(sources: [
|
||||
item.getThumbImage(maxWidth: 350),
|
||||
item.getBackdropImage(maxWidth: 350),
|
||||
],
|
||||
blurHash: item.getBackdropImageBlurHash())
|
||||
ImageView([
|
||||
.init(url: item.getThumbImage(maxWidth: 350)),
|
||||
.init(url: item.getBackdropImage(maxWidth: 350), blurHash: item.getBackdropImageBlurHash()),
|
||||
])
|
||||
.frame(width: 350, height: 210)
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,10 @@ struct CinematicResumeCardView: View {
|
|||
])
|
||||
.frame(width: 350, height: 210)
|
||||
} else {
|
||||
ImageView(sources: [
|
||||
item.getThumbImage(maxWidth: 350),
|
||||
item.getBackdropImage(maxWidth: 350),
|
||||
],
|
||||
blurHash: item.getBackdropImageBlurHash())
|
||||
ImageView([
|
||||
.init(url: item.getThumbImage(maxWidth: 350)),
|
||||
.init(url: item.getBackdropImage(maxWidth: 350), blurHash: item.getBackdropImageBlurHash()),
|
||||
])
|
||||
.frame(width: 350, height: 210)
|
||||
}
|
||||
|
||||
|
|
|
@ -38,31 +38,6 @@ 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()
|
||||
|
@ -81,6 +56,31 @@ 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 {
|
||||
|
|
|
@ -700,7 +700,7 @@ extension LiveTVPlayerViewController: 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 {
|
||||
|
@ -720,7 +720,7 @@ extension LiveTVPlayerViewController: VLCMediaPlayerDelegate {
|
|||
|
||||
// MARK: mediaPlayerTimeChanged
|
||||
|
||||
func mediaPlayerTimeChanged(_ aNotification: Notification!) {
|
||||
func mediaPlayerTimeChanged(_ aNotification: Notification) {
|
||||
|
||||
if !viewModel.sliderIsScrubbing {
|
||||
viewModel.sliderPercentage = Double(vlcMediaPlayer.position)
|
||||
|
|
|
@ -700,7 +700,7 @@ 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 {
|
||||
|
@ -720,7 +720,7 @@ extension VLCPlayerViewController: VLCMediaPlayerDelegate {
|
|||
|
||||
// MARK: mediaPlayerTimeChanged
|
||||
|
||||
func mediaPlayerTimeChanged(_ aNotification: Notification!) {
|
||||
func mediaPlayerTimeChanged(_ aNotification: Notification) {
|
||||
|
||||
if !viewModel.sliderIsScrubbing {
|
||||
viewModel.sliderPercentage = Double(vlcMediaPlayer.position)
|
||||
|
|
Loading…
Reference in New Issue