[create-pull-request] automated change (#52)
Co-authored-by: acvigue <acvigue@users.noreply.github.com>
This commit is contained in:
parent
18cc3ac15d
commit
770ad0fbf8
|
@ -274,7 +274,7 @@ struct ConnectToServerView: View {
|
||||||
ForEach(publicUsers, id: \.id) { publicUser in
|
ForEach(publicUsers, id: \.id) { publicUser in
|
||||||
HStack {
|
HStack {
|
||||||
Button() {
|
Button() {
|
||||||
if (publicUser.hasPassword ?? true) {
|
if publicUser.hasPassword ?? true {
|
||||||
lastPublicUsers = publicUsers
|
lastPublicUsers = publicUsers
|
||||||
username = publicUser.name ?? ""
|
username = publicUser.name ?? ""
|
||||||
usernameDisabled = true
|
usernameDisabled = true
|
||||||
|
|
|
@ -147,7 +147,7 @@ struct ContentView: View {
|
||||||
.environmentObject(globalData)
|
.environmentObject(globalData)
|
||||||
} else {
|
} else {
|
||||||
if !jsi.did {
|
if !jsi.did {
|
||||||
if(isLoading) {
|
if isLoading {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
} else {
|
} else {
|
||||||
VStack {
|
VStack {
|
||||||
|
@ -158,7 +158,7 @@ struct ContentView: View {
|
||||||
Spacer().frame(height: orientationInfo.orientation == .portrait ? 0 : 16)
|
Spacer().frame(height: orientationInfo.orientation == .portrait ? 0 : 16)
|
||||||
ContinueWatchingView()
|
ContinueWatchingView()
|
||||||
NextUpView()
|
NextUpView()
|
||||||
|
|
||||||
ForEach(librariesShowRecentlyAdded, id: \.self) { library_id in
|
ForEach(librariesShowRecentlyAdded, id: \.self) { library_id in
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
HStack {
|
HStack {
|
||||||
|
@ -169,7 +169,7 @@ struct ContentView: View {
|
||||||
LibraryView(usingParentID: library_id,
|
LibraryView(usingParentID: library_id,
|
||||||
title: library_names[library_id] ?? "", usingFilters: recentFilterSet)
|
title: library_names[library_id] ?? "", usingFilters: recentFilterSet)
|
||||||
}) {
|
}) {
|
||||||
HStack() {
|
HStack {
|
||||||
Text("See All").font(.subheadline).fontWeight(.bold)
|
Text("See All").font(.subheadline).fontWeight(.bold)
|
||||||
Image(systemName: "chevron.right").font(Font.subheadline.bold())
|
Image(systemName: "chevron.right").font(Font.subheadline.bold())
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ struct ContentView: View {
|
||||||
LatestMediaView(usingParentID: library_id)
|
LatestMediaView(usingParentID: library_id)
|
||||||
}.padding(EdgeInsets(top: 4, leading: 0, bottom: 0, trailing: 0))
|
}.padding(EdgeInsets(top: 4, leading: 0, bottom: 0, trailing: 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer().frame(height: UIDevice.current.userInterfaceIdiom == .phone ? 20 : 30)
|
Spacer().frame(height: UIDevice.current.userInterfaceIdiom == .phone ? 20 : 30)
|
||||||
}
|
}
|
||||||
.navigationTitle("Home")
|
.navigationTitle("Home")
|
||||||
|
|
|
@ -61,7 +61,7 @@ struct LatestMediaView: View {
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
if(item.productionYear != nil) {
|
if item.productionYear != nil {
|
||||||
Text(String(item.productionYear ?? 0))
|
Text(String(item.productionYear ?? 0))
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
|
|
|
@ -84,7 +84,7 @@ struct LibrarySearchView: View {
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
if(item.productionYear != nil) {
|
if item.productionYear != nil {
|
||||||
Text(String(item.productionYear ?? 0))
|
Text(String(item.productionYear ?? 0))
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
|
|
|
@ -122,7 +122,7 @@ struct LibraryView: View {
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
if(item.productionYear != nil) {
|
if item.productionYear != nil {
|
||||||
Text(String(item.productionYear ?? 0))
|
Text(String(item.productionYear ?? 0))
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
|
|
|
@ -96,7 +96,7 @@ struct MovieItemView: View {
|
||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
.offset(y: -4)
|
.offset(y: -4)
|
||||||
HStack {
|
HStack {
|
||||||
if(item.productionYear != nil) {
|
if item.productionYear != nil {
|
||||||
Text(String(item.productionYear ?? 0)).font(.subheadline)
|
Text(String(item.productionYear ?? 0)).font(.subheadline)
|
||||||
.fontWeight(.medium)
|
.fontWeight(.medium)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
|
@ -313,7 +313,7 @@ struct MovieItemView: View {
|
||||||
.offset(x: 14, y: 0)
|
.offset(x: 14, y: 0)
|
||||||
Spacer().frame(height: 1)
|
Spacer().frame(height: 1)
|
||||||
HStack {
|
HStack {
|
||||||
if(item.productionYear != nil) {
|
if item.productionYear != nil {
|
||||||
Text(String(item.productionYear ?? 0)).font(.subheadline)
|
Text(String(item.productionYear ?? 0)).font(.subheadline)
|
||||||
.fontWeight(.medium)
|
.fontWeight(.medium)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
|
|
|
@ -296,7 +296,7 @@ struct SeasonItemView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
if(isLoading) {
|
if isLoading {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
.onAppear(perform: onAppear)
|
.onAppear(perform: onAppear)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct SeriesItemView: View {
|
||||||
@State private var tracks: [GridItem] = []
|
@State private var tracks: [GridItem] = []
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
if(isLoading) {
|
if isLoading {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
.onAppear(perform: onAppear)
|
.onAppear(perform: onAppear)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -262,7 +262,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
|
||||||
// View has loaded.
|
// View has loaded.
|
||||||
|
|
||||||
// Rotate to landscape only if necessary
|
// Rotate to landscape only if necessary
|
||||||
|
|
||||||
UIViewController.attemptRotationToDeviceOrientation()
|
UIViewController.attemptRotationToDeviceOrientation()
|
||||||
|
|
||||||
mediaPlayer.perform(Selector(("setTextRendererFontSize:")), with: 14)
|
mediaPlayer.perform(Selector(("setTextRendererFontSize:")), with: 14)
|
||||||
|
@ -310,7 +310,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
|
||||||
for stream in mediaSource.mediaStreams! {
|
for stream in mediaSource.mediaStreams! {
|
||||||
if stream.type == .subtitle {
|
if stream.type == .subtitle {
|
||||||
var deliveryUrl: URL?
|
var deliveryUrl: URL?
|
||||||
if(stream.deliveryMethod == .external) {
|
if stream.deliveryMethod == .external {
|
||||||
deliveryUrl = URL(string: "\(globalData.server.baseURI!)\(stream.deliveryUrl!)")!
|
deliveryUrl = URL(string: "\(globalData.server.baseURI!)\(stream.deliveryUrl!)")!
|
||||||
} else {
|
} else {
|
||||||
deliveryUrl = nil
|
deliveryUrl = nil
|
||||||
|
@ -351,7 +351,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
|
||||||
for stream in mediaSource.mediaStreams! {
|
for stream in mediaSource.mediaStreams! {
|
||||||
if stream.type == .subtitle {
|
if stream.type == .subtitle {
|
||||||
var deliveryUrl: URL?
|
var deliveryUrl: URL?
|
||||||
if(stream.deliveryMethod == .external) {
|
if stream.deliveryMethod == .external {
|
||||||
deliveryUrl = URL(string: "\(globalData.server.baseURI!)\(stream.deliveryUrl!)")!
|
deliveryUrl = URL(string: "\(globalData.server.baseURI!)\(stream.deliveryUrl!)")!
|
||||||
} else {
|
} else {
|
||||||
deliveryUrl = nil
|
deliveryUrl = nil
|
||||||
|
@ -381,26 +381,26 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
|
||||||
|
|
||||||
mediaPlayer.media = VLCMedia(url: playbackItem.videoUrl)
|
mediaPlayer.media = VLCMedia(url: playbackItem.videoUrl)
|
||||||
mediaPlayer.play()
|
mediaPlayer.play()
|
||||||
|
|
||||||
//1 second = 10,000,000 ticks
|
// 1 second = 10,000,000 ticks
|
||||||
|
|
||||||
let startTicks = round(Double(manifest.userData?.playbackPositionTicks ?? 0), toNearest: 10_000_000)
|
let startTicks = round(Double(manifest.userData?.playbackPositionTicks ?? 0), toNearest: 10_000_000)
|
||||||
let startSeconds = Int32(startTicks) / 10_000_000
|
let startSeconds = Int32(startTicks) / 10_000_000
|
||||||
mediaPlayer.jumpForward(startSeconds)
|
mediaPlayer.jumpForward(startSeconds)
|
||||||
|
|
||||||
//Pause and load captions into memory.
|
// Pause and load captions into memory.
|
||||||
mediaPlayer.pause()
|
mediaPlayer.pause()
|
||||||
subtitleTrackArray.forEach { sub in
|
subtitleTrackArray.forEach { sub in
|
||||||
if sub.id != -1 && sub.delivery == .external && sub.codec != "subrip" {
|
if sub.id != -1 && sub.delivery == .external && sub.codec != "subrip" {
|
||||||
mediaPlayer.addPlaybackSlave(sub.url!, type: .subtitle, enforce: false)
|
mediaPlayer.addPlaybackSlave(sub.url!, type: .subtitle, enforce: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Wait for captions to load
|
// Wait for captions to load
|
||||||
delegate?.showLoadingView(self)
|
delegate?.showLoadingView(self)
|
||||||
while mediaPlayer.numberOfSubtitlesTracks != subtitleTrackArray.count - 1 {}
|
while mediaPlayer.numberOfSubtitlesTracks != subtitleTrackArray.count - 1 {}
|
||||||
|
|
||||||
//Select default track & resume playback
|
// Select default track & resume playback
|
||||||
mediaPlayer.currentVideoSubTitleIndex = selectedCaptionTrack
|
mediaPlayer.currentVideoSubTitleIndex = selectedCaptionTrack
|
||||||
mediaPlayer.pause()
|
mediaPlayer.pause()
|
||||||
mediaPlayer.play()
|
mediaPlayer.play()
|
||||||
|
|
|
@ -52,7 +52,7 @@ extension BaseItemDto {
|
||||||
|
|
||||||
if self.primaryImageAspectRatio ?? 0.0 < 1.0 {
|
if self.primaryImageAspectRatio ?? 0.0 < 1.0 {
|
||||||
imageType = "Backdrop"
|
imageType = "Backdrop"
|
||||||
if(!(self.backdropImageTags?.isEmpty ?? true)) {
|
if !(self.backdropImageTags?.isEmpty ?? true) {
|
||||||
imageTag = (self.backdropImageTags ?? [""])[0]
|
imageTag = (self.backdropImageTags ?? [""])[0]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -62,11 +62,11 @@ extension BaseItemDto {
|
||||||
|
|
||||||
if imageTag == "" {
|
if imageTag == "" {
|
||||||
imageType = "Backdrop"
|
imageType = "Backdrop"
|
||||||
if(!(self.parentBackdropImageTags?.isEmpty ?? true)) {
|
if !(self.parentBackdropImageTags?.isEmpty ?? true) {
|
||||||
imageTag = (self.parentBackdropImageTags ?? [""])[0]
|
imageTag = (self.parentBackdropImageTags ?? [""])[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let x = UIScreen.main.nativeScale * CGFloat(maxWidth)
|
let x = UIScreen.main.nativeScale * CGFloat(maxWidth)
|
||||||
let urlString = "\(baseURL)/Items/\(self.id ?? "")/Images/\(imageType)?maxWidth=\(String(Int(x)))&quality=60&tag=\(imageTag)"
|
let urlString = "\(baseURL)/Items/\(self.id ?? "")/Images/\(imageType)?maxWidth=\(String(Int(x)))&quality=60&tag=\(imageTag)"
|
||||||
return URL(string: urlString)!
|
return URL(string: urlString)!
|
||||||
|
|
Loading…
Reference in New Issue