[create-pull-request] automated change (#52)

Co-authored-by: acvigue <acvigue@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2021-06-10 17:39:31 -07:00 committed by GitHub
parent 18cc3ac15d
commit 770ad0fbf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 27 additions and 27 deletions

View File

@ -274,7 +274,7 @@ struct ConnectToServerView: View {
ForEach(publicUsers, id: \.id) { publicUser in
HStack {
Button() {
if (publicUser.hasPassword ?? true) {
if publicUser.hasPassword ?? true {
lastPublicUsers = publicUsers
username = publicUser.name ?? ""
usernameDisabled = true

View File

@ -147,7 +147,7 @@ struct ContentView: View {
.environmentObject(globalData)
} else {
if !jsi.did {
if(isLoading) {
if isLoading {
ProgressView()
} else {
VStack {
@ -158,7 +158,7 @@ struct ContentView: View {
Spacer().frame(height: orientationInfo.orientation == .portrait ? 0 : 16)
ContinueWatchingView()
NextUpView()
ForEach(librariesShowRecentlyAdded, id: \.self) { library_id in
VStack(alignment: .leading) {
HStack {
@ -169,7 +169,7 @@ struct ContentView: View {
LibraryView(usingParentID: library_id,
title: library_names[library_id] ?? "", usingFilters: recentFilterSet)
}) {
HStack() {
HStack {
Text("See All").font(.subheadline).fontWeight(.bold)
Image(systemName: "chevron.right").font(Font.subheadline.bold())
}
@ -178,7 +178,7 @@ struct ContentView: View {
LatestMediaView(usingParentID: library_id)
}.padding(EdgeInsets(top: 4, leading: 0, bottom: 0, trailing: 0))
}
Spacer().frame(height: UIDevice.current.userInterfaceIdiom == .phone ? 20 : 30)
}
.navigationTitle("Home")

View File

@ -61,7 +61,7 @@ struct LatestMediaView: View {
.fontWeight(.semibold)
.foregroundColor(.primary)
.lineLimit(1)
if(item.productionYear != nil) {
if item.productionYear != nil {
Text(String(item.productionYear ?? 0))
.foregroundColor(.secondary)
.font(.caption)

View File

@ -84,7 +84,7 @@ struct LibrarySearchView: View {
.fontWeight(.semibold)
.foregroundColor(.primary)
.lineLimit(1)
if(item.productionYear != nil) {
if item.productionYear != nil {
Text(String(item.productionYear ?? 0))
.foregroundColor(.secondary)
.font(.caption)

View File

@ -122,7 +122,7 @@ struct LibraryView: View {
.fontWeight(.semibold)
.foregroundColor(.primary)
.lineLimit(1)
if(item.productionYear != nil) {
if item.productionYear != nil {
Text(String(item.productionYear ?? 0))
.foregroundColor(.secondary)
.font(.caption)

View File

@ -96,7 +96,7 @@ struct MovieItemView: View {
.fixedSize(horizontal: false, vertical: true)
.offset(y: -4)
HStack {
if(item.productionYear != nil) {
if item.productionYear != nil {
Text(String(item.productionYear ?? 0)).font(.subheadline)
.fontWeight(.medium)
.foregroundColor(.secondary)
@ -313,7 +313,7 @@ struct MovieItemView: View {
.offset(x: 14, y: 0)
Spacer().frame(height: 1)
HStack {
if(item.productionYear != nil) {
if item.productionYear != nil {
Text(String(item.productionYear ?? 0)).font(.subheadline)
.fontWeight(.medium)
.foregroundColor(.secondary)

View File

@ -296,7 +296,7 @@ struct SeasonItemView: View {
}
var body: some View {
if(isLoading) {
if isLoading {
ProgressView()
.onAppear(perform: onAppear)
} else {

View File

@ -51,7 +51,7 @@ struct SeriesItemView: View {
@State private var tracks: [GridItem] = []
var body: some View {
if(isLoading) {
if isLoading {
ProgressView()
.onAppear(perform: onAppear)
} else {

View File

@ -262,7 +262,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
// View has loaded.
// Rotate to landscape only if necessary
UIViewController.attemptRotationToDeviceOrientation()
mediaPlayer.perform(Selector(("setTextRendererFontSize:")), with: 14)
@ -310,7 +310,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
for stream in mediaSource.mediaStreams! {
if stream.type == .subtitle {
var deliveryUrl: URL?
if(stream.deliveryMethod == .external) {
if stream.deliveryMethod == .external {
deliveryUrl = URL(string: "\(globalData.server.baseURI!)\(stream.deliveryUrl!)")!
} else {
deliveryUrl = nil
@ -351,7 +351,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
for stream in mediaSource.mediaStreams! {
if stream.type == .subtitle {
var deliveryUrl: URL?
if(stream.deliveryMethod == .external) {
if stream.deliveryMethod == .external {
deliveryUrl = URL(string: "\(globalData.server.baseURI!)\(stream.deliveryUrl!)")!
} else {
deliveryUrl = nil
@ -381,26 +381,26 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe
mediaPlayer.media = VLCMedia(url: playbackItem.videoUrl)
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 startSeconds = Int32(startTicks) / 10_000_000
mediaPlayer.jumpForward(startSeconds)
//Pause and load captions into memory.
// Pause and load captions into memory.
mediaPlayer.pause()
subtitleTrackArray.forEach { sub in
if sub.id != -1 && sub.delivery == .external && sub.codec != "subrip" {
mediaPlayer.addPlaybackSlave(sub.url!, type: .subtitle, enforce: false)
}
}
//Wait for captions to load
// Wait for captions to load
delegate?.showLoadingView(self)
while mediaPlayer.numberOfSubtitlesTracks != subtitleTrackArray.count - 1 {}
//Select default track & resume playback
// Select default track & resume playback
mediaPlayer.currentVideoSubTitleIndex = selectedCaptionTrack
mediaPlayer.pause()
mediaPlayer.play()

View File

@ -52,7 +52,7 @@ extension BaseItemDto {
if self.primaryImageAspectRatio ?? 0.0 < 1.0 {
imageType = "Backdrop"
if(!(self.backdropImageTags?.isEmpty ?? true)) {
if !(self.backdropImageTags?.isEmpty ?? true) {
imageTag = (self.backdropImageTags ?? [""])[0]
}
} else {
@ -62,11 +62,11 @@ extension BaseItemDto {
if imageTag == "" {
imageType = "Backdrop"
if(!(self.parentBackdropImageTags?.isEmpty ?? true)) {
if !(self.parentBackdropImageTags?.isEmpty ?? true) {
imageTag = (self.parentBackdropImageTags ?? [""])[0]
}
}
let x = UIScreen.main.nativeScale * CGFloat(maxWidth)
let urlString = "\(baseURL)/Items/\(self.id ?? "")/Images/\(imageType)?maxWidth=\(String(Int(x)))&quality=60&tag=\(imageTag)"
return URL(string: urlString)!