Merge branch 'main' into weblate
This commit is contained in:
commit
ef3905661a
|
@ -0,0 +1,47 @@
|
||||||
|
//
|
||||||
|
/*
|
||||||
|
* SwiftFin is subject to the terms of the Mozilla Public
|
||||||
|
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*
|
||||||
|
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||||
|
*/
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct MediaPlayButtonRowView: View {
|
||||||
|
|
||||||
|
@ObservedObject var viewModel: DetailItemViewModel
|
||||||
|
@State var wrappedScrollView: UIScrollView?
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
HStack {
|
||||||
|
VStack {
|
||||||
|
NavigationLink(destination: VideoPlayerView(item: viewModel.item)) {
|
||||||
|
MediaViewActionButton(icon: "play.fill", scrollView: $wrappedScrollView)
|
||||||
|
}
|
||||||
|
Text(viewModel.item.getItemProgressString() != "" ? "\(viewModel.item.getItemProgressString()) left" : "Play")
|
||||||
|
.font(.caption)
|
||||||
|
}
|
||||||
|
VStack {
|
||||||
|
Button {
|
||||||
|
viewModel.updateWatchState()
|
||||||
|
} label: {
|
||||||
|
MediaViewActionButton(icon: "eye.fill", scrollView: $wrappedScrollView, iconColor: viewModel.isWatched ? .red : .white)
|
||||||
|
}
|
||||||
|
Text(viewModel.isWatched ? "Unwatch" : "Mark Watched")
|
||||||
|
.font(.caption)
|
||||||
|
}
|
||||||
|
VStack {
|
||||||
|
Button {
|
||||||
|
viewModel.updateFavoriteState()
|
||||||
|
} label: {
|
||||||
|
MediaViewActionButton(icon: "heart.fill", scrollView: $wrappedScrollView, iconColor: viewModel.isFavorited ? .red : .white)
|
||||||
|
}
|
||||||
|
Text(viewModel.isFavorited ? "Unfavorite" : "Favorite")
|
||||||
|
.font(.caption)
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -129,34 +129,7 @@ struct MovieItemView: View {
|
||||||
.fontWeight(.medium)
|
.fontWeight(.medium)
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
|
|
||||||
HStack {
|
MediaPlayButtonRowView(viewModel: viewModel, wrappedScrollView: wrappedScrollView)
|
||||||
VStack {
|
|
||||||
Button {
|
|
||||||
viewModel.updateFavoriteState()
|
|
||||||
} label: {
|
|
||||||
MediaViewActionButton(icon: "heart.fill", scrollView: $wrappedScrollView, iconColor: viewModel.isFavorited ? .red : .white)
|
|
||||||
}
|
|
||||||
Text(viewModel.isFavorited ? "Unfavorite" : "Favorite")
|
|
||||||
.font(.caption)
|
|
||||||
}
|
|
||||||
VStack {
|
|
||||||
NavigationLink(destination: VideoPlayerView(item: viewModel.item)) {
|
|
||||||
MediaViewActionButton(icon: "play.fill", scrollView: $wrappedScrollView)
|
|
||||||
}
|
|
||||||
Text(viewModel.item.getItemProgressString() != "" ? "\(viewModel.item.getItemProgressString()) left" : "Play")
|
|
||||||
.font(.caption)
|
|
||||||
}
|
|
||||||
VStack {
|
|
||||||
Button {
|
|
||||||
viewModel.updateWatchState()
|
|
||||||
} label: {
|
|
||||||
MediaViewActionButton(icon: "eye.fill", scrollView: $wrappedScrollView, iconColor: viewModel.isWatched ? .red : .white)
|
|
||||||
}
|
|
||||||
Text(viewModel.isWatched ? "Unwatch" : "Mark Watched")
|
|
||||||
.font(.caption)
|
|
||||||
}
|
|
||||||
Spacer()
|
|
||||||
}
|
|
||||||
.padding(.top, 15)
|
.padding(.top, 15)
|
||||||
.addFocusGuide(using: focusBag, name: "actionButtons", destinations: [.bottom: "moreLikeThis"], debug: false)
|
.addFocusGuide(using: focusBag, name: "actionButtons", destinations: [.bottom: "moreLikeThis"], debug: false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,35 +135,8 @@ struct SeriesItemView: View {
|
||||||
.fontWeight(.medium)
|
.fontWeight(.medium)
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
|
|
||||||
HStack {
|
MediaPlayButtonRowView(viewModel: viewModel, wrappedScrollView: wrappedScrollView)
|
||||||
VStack {
|
.padding(.top, 15)
|
||||||
Button {
|
|
||||||
viewModel.updateFavoriteState()
|
|
||||||
} label: {
|
|
||||||
MediaViewActionButton(icon: "heart.fill", scrollView: $wrappedScrollView, iconColor: viewModel.isFavorited ? .red : .white)
|
|
||||||
}.prefersDefaultFocus(in: namespace)
|
|
||||||
Text(viewModel.isFavorited ? "Unfavorite" : "Favorite")
|
|
||||||
.font(.caption)
|
|
||||||
}
|
|
||||||
if viewModel.nextUpItem != nil {
|
|
||||||
VStack {
|
|
||||||
NavigationLink(destination: VideoPlayerView(item: viewModel.nextUpItem!)) {
|
|
||||||
MediaViewActionButton(icon: "play.fill", scrollView: $wrappedScrollView)
|
|
||||||
}
|
|
||||||
Text("Play • \(viewModel.nextUpItem!.getEpisodeLocator())")
|
|
||||||
.font(.caption)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
VStack {
|
|
||||||
Button {
|
|
||||||
viewModel.updateWatchState()
|
|
||||||
} label: {
|
|
||||||
MediaViewActionButton(icon: "eye.fill", scrollView: $wrappedScrollView, iconColor: viewModel.isWatched ? .red : .white)
|
|
||||||
}
|
|
||||||
Text(viewModel.isWatched ? "Unwatch" : "Mark Watched")
|
|
||||||
.font(.caption)
|
|
||||||
}
|
|
||||||
}.padding(.top, 15)
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
}.padding(.top, 50)
|
}.padding(.top, 50)
|
||||||
|
|
|
@ -196,6 +196,7 @@
|
||||||
62EC353226766849000E9F2D /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62EC352E267666A5000E9F2D /* SessionManager.swift */; };
|
62EC353226766849000E9F2D /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62EC352E267666A5000E9F2D /* SessionManager.swift */; };
|
||||||
62EC353426766B03000E9F2D /* DeviceRotationViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62EC353326766B03000E9F2D /* DeviceRotationViewModifier.swift */; };
|
62EC353426766B03000E9F2D /* DeviceRotationViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62EC353326766B03000E9F2D /* DeviceRotationViewModifier.swift */; };
|
||||||
AE8C3159265D6F90008AA076 /* bitrates.json in Resources */ = {isa = PBXBuildFile; fileRef = AE8C3158265D6F90008AA076 /* bitrates.json */; };
|
AE8C3159265D6F90008AA076 /* bitrates.json in Resources */ = {isa = PBXBuildFile; fileRef = AE8C3158265D6F90008AA076 /* bitrates.json */; };
|
||||||
|
E100720726BDABC100CE3E31 /* MediaPlayButtonRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E100720626BDABC100CE3E31 /* MediaPlayButtonRowView.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
@ -374,6 +375,7 @@
|
||||||
BEEC50E7EFD4848C0E320941 /* Pods-JellyfinPlayer iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JellyfinPlayer iOS.release.xcconfig"; path = "Target Support Files/Pods-JellyfinPlayer iOS/Pods-JellyfinPlayer iOS.release.xcconfig"; sourceTree = "<group>"; };
|
BEEC50E7EFD4848C0E320941 /* Pods-JellyfinPlayer iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JellyfinPlayer iOS.release.xcconfig"; path = "Target Support Files/Pods-JellyfinPlayer iOS/Pods-JellyfinPlayer iOS.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
D79953919FED0C4DF72BA578 /* Pods-JellyfinPlayer tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JellyfinPlayer tvOS.release.xcconfig"; path = "Target Support Files/Pods-JellyfinPlayer tvOS/Pods-JellyfinPlayer tvOS.release.xcconfig"; sourceTree = "<group>"; };
|
D79953919FED0C4DF72BA578 /* Pods-JellyfinPlayer tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JellyfinPlayer tvOS.release.xcconfig"; path = "Target Support Files/Pods-JellyfinPlayer tvOS/Pods-JellyfinPlayer tvOS.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
DE5004F745B19E28744A7DE7 /* Pods-JellyfinPlayer tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JellyfinPlayer tvOS.debug.xcconfig"; path = "Target Support Files/Pods-JellyfinPlayer tvOS/Pods-JellyfinPlayer tvOS.debug.xcconfig"; sourceTree = "<group>"; };
|
DE5004F745B19E28744A7DE7 /* Pods-JellyfinPlayer tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JellyfinPlayer tvOS.debug.xcconfig"; path = "Target Support Files/Pods-JellyfinPlayer tvOS/Pods-JellyfinPlayer tvOS.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
E100720626BDABC100CE3E31 /* MediaPlayButtonRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaPlayButtonRowView.swift; sourceTree = "<group>"; };
|
||||||
EBFE1F64394BCC2EFFF1610D /* Pods_JellyfinPlayer_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JellyfinPlayer_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
EBFE1F64394BCC2EFFF1610D /* Pods_JellyfinPlayer_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JellyfinPlayer_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
@ -581,6 +583,7 @@
|
||||||
536D3D87267C17350004248C /* PublicUserButton.swift */,
|
536D3D87267C17350004248C /* PublicUserButton.swift */,
|
||||||
53116A18268B947A003024C9 /* PlainLinkButton.swift */,
|
53116A18268B947A003024C9 /* PlainLinkButton.swift */,
|
||||||
53272531268BF09D0035FBF1 /* MediaViewActionButton.swift */,
|
53272531268BF09D0035FBF1 /* MediaViewActionButton.swift */,
|
||||||
|
E100720626BDABC100CE3E31 /* MediaPlayButtonRowView.swift */,
|
||||||
);
|
);
|
||||||
path = Components;
|
path = Components;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -1084,6 +1087,7 @@
|
||||||
62E632F4267D54030063E547 /* DetailItemViewModel.swift in Sources */,
|
62E632F4267D54030063E547 /* DetailItemViewModel.swift in Sources */,
|
||||||
6267B3D826710B9800A7371D /* CollectionExtensions.swift in Sources */,
|
6267B3D826710B9800A7371D /* CollectionExtensions.swift in Sources */,
|
||||||
62E632E7267D3F5B0063E547 /* EpisodeItemViewModel.swift in Sources */,
|
62E632E7267D3F5B0063E547 /* EpisodeItemViewModel.swift in Sources */,
|
||||||
|
E100720726BDABC100CE3E31 /* MediaPlayButtonRowView.swift in Sources */,
|
||||||
535870A52669D8AE00D05A09 /* ParallaxHeader.swift in Sources */,
|
535870A52669D8AE00D05A09 /* ParallaxHeader.swift in Sources */,
|
||||||
53272532268BF09D0035FBF1 /* MediaViewActionButton.swift in Sources */,
|
53272532268BF09D0035FBF1 /* MediaViewActionButton.swift in Sources */,
|
||||||
531690F0267ABF72005D8AB9 /* NextUpView.swift in Sources */,
|
531690F0267ABF72005D8AB9 /* NextUpView.swift in Sources */,
|
||||||
|
|
|
@ -32,7 +32,7 @@ Check out our [Weblate instance](https://translate.jellyfin.org/projects/swiftfi
|
||||||
|
|
||||||
## ⚙️ Development
|
## ⚙️ Development
|
||||||
|
|
||||||
Xcode 13.0 with command line tools.
|
Xcode 12.5 with command line tools.
|
||||||
|
|
||||||
### Build Process
|
### Build Process
|
||||||
|
|
||||||
|
|
|
@ -16,13 +16,21 @@ struct SearchBar: View {
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
|
// TODO: Clean up the statement as previously done
|
||||||
|
// in commit 93a25eb9c43eddd03e09df87722c086fb6cb6da4
|
||||||
|
// after Swift 5.5 is released.
|
||||||
|
#if os(iOS)
|
||||||
TextField(NSLocalizedString("Search...", comment: ""), text: $text)
|
TextField(NSLocalizedString("Search...", comment: ""), text: $text)
|
||||||
.padding(8)
|
.padding(8)
|
||||||
.padding(.horizontal, 16)
|
.padding(.horizontal, 16)
|
||||||
#if os(iOS)
|
|
||||||
.background(Color(.systemGray6))
|
.background(Color(.systemGray6))
|
||||||
#endif
|
|
||||||
.cornerRadius(8)
|
.cornerRadius(8)
|
||||||
|
#else
|
||||||
|
TextField(NSLocalizedString("Search...", comment: ""), text: $text)
|
||||||
|
.padding(8)
|
||||||
|
.padding(.horizontal, 16)
|
||||||
|
.cornerRadius(8)
|
||||||
|
#endif
|
||||||
if !text.isEmpty {
|
if !text.isEmpty {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
self.text = ""
|
self.text = ""
|
||||||
|
|
Loading…
Reference in New Issue