Resolve some todos (#1295)
Some checks failed
Build 🔨 / Build 🔨 (Swiftfin tvOS) (push) Has been cancelled
Build 🔨 / Build 🔨 (Swiftfin) (push) Has been cancelled

* Partially resolve color todo

* Update localizations for quick connect steps. use bulleted list

* Same change for tvos

* Remove padding2 modifier

* Localisation
This commit is contained in:
Daniel Chick 2024-10-29 12:17:56 -05:00 committed by GitHub
parent 56fa03257e
commit fed9c654ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 52 additions and 70 deletions

View File

@ -8,19 +8,16 @@
import SwiftUI
// TODO: add all other missing colors from UIColor and fix usages
// - move row dividers to divider color
extension Color {
static let jellyfinPurple = Color(uiColor: .jellyfinPurple)
static let jellyfinPurple = Color(red: 172 / 255, green: 92 / 255, blue: 195 / 255, opacity: 1)
var uiColor: UIColor {
UIColor(self)
}
var overlayColor: Color {
Color(uiColor: uiColor.overlayColor)
Color(uiColor: uiColor.overlayColor) // TODO: move from UIColor
}
// TODO: Correct and add colors

View File

@ -26,17 +26,16 @@ extension ItemTrait: ItemFilter {
}
extension ItemTrait: Displayable {
// TODO: Localize
var displayTitle: String {
switch self {
case .isUnplayed:
return "Unplayed"
return L10n.unplayed
case .isPlayed:
return "Played"
return L10n.played
case .isFavorite:
return "Favorites"
return L10n.favorites
case .likes:
return "Liked Items"
return L10n.likedItems
default:
return ""
}

View File

@ -9,9 +9,6 @@
import UIKit
extension UIColor {
static let jellyfinPurple = UIColor(red: 172 / 255, green: 92 / 255, blue: 195 / 255, alpha: 1)
var overlayColor: UIColor {
var red: CGFloat = 0
var green: CGFloat = 0

View File

@ -131,12 +131,6 @@ extension View {
})
}
// TODO: remove
@inlinable
func padding2(_ edges: Edge.Set = .all) -> some View {
padding(edges).padding(edges)
}
func scrollViewOffset(_ scrollViewOffset: Binding<CGFloat>) -> some View {
modifier(ScrollViewOffsetModifier(scrollViewOffset: scrollViewOffset))
}

View File

@ -464,6 +464,8 @@ internal enum L10n {
internal static let library = L10n.tr("Localizable", "library", fallback: "Library")
/// Represents the light theme setting
internal static let light = L10n.tr("Localizable", "light", fallback: "Light")
/// Liked Items
internal static let likedItems = L10n.tr("Localizable", "likedItems", fallback: "Liked Items")
/// List
internal static let list = L10n.tr("Localizable", "list", fallback: "List")
/// Live TV
@ -658,12 +660,12 @@ internal enum L10n {
internal static let quickConnectInvalidError = L10n.tr("Localizable", "quickConnectInvalidError", fallback: "Invalid Quick Connect code")
/// Note: Quick Connect not enabled
internal static let quickConnectNotEnabled = L10n.tr("Localizable", "quickConnectNotEnabled", fallback: "Note: Quick Connect not enabled")
/// 1. Open the Jellyfin app on your phone or web browser and sign in with your account
internal static let quickConnectStep1 = L10n.tr("Localizable", "quickConnectStep1", fallback: "1. Open the Jellyfin app on your phone or web browser and sign in with your account")
/// 2. Open the user menu and go to the Quick Connect page
internal static let quickConnectStep2 = L10n.tr("Localizable", "quickConnectStep2", fallback: "2. Open the user menu and go to the Quick Connect page")
/// 3. Enter the following code:
internal static let quickConnectStep3 = L10n.tr("Localizable", "quickConnectStep3", fallback: "3. Enter the following code:")
/// Open the Jellyfin app on your phone or web browser and sign in with your account
internal static let quickConnectStep1 = L10n.tr("Localizable", "quickConnectStep1", fallback: "Open the Jellyfin app on your phone or web browser and sign in with your account")
/// Open the user menu and go to the Quick Connect page
internal static let quickConnectStep2 = L10n.tr("Localizable", "quickConnectStep2", fallback: "Open the user menu and go to the Quick Connect page")
/// Enter the following code:
internal static let quickConnectStep3 = L10n.tr("Localizable", "quickConnectStep3", fallback: "Enter the following code:")
/// Authorizing Quick Connect successful. Please continue on your other device.
internal static let quickConnectSuccessMessage = L10n.tr("Localizable", "quickConnectSuccessMessage", fallback: "Authorizing Quick Connect successful. Please continue on your other device.")
/// Random

View File

@ -38,7 +38,7 @@ extension ItemView.AboutView {
content()
.eraseToAnyView()
}
.padding2()
.padding()
.frame(width: 700, height: 405)
}
.buttonStyle(.card)

View File

@ -106,7 +106,7 @@ struct MediaSourceInfoView: View {
}
}
}
.padding2(.horizontal)
.padding(.horizontal)
}
.frame(maxWidth: .infinity)
}

View File

@ -25,17 +25,14 @@ struct QuickConnectView: View {
private func pollingView(code: String) -> some View {
VStack(alignment: .leading, spacing: 20) {
// TODO: change strings so that numbers are removed
// and use `BulletedList`
// - also probably rephrase/change steps
L10n.quickConnectStep1.text
L10n.quickConnectStep2.text
L10n.quickConnectStep3.text
.padding(.bottom)
BulletedList {
L10n.quickConnectStep1.text
.padding(.bottom)
L10n.quickConnectStep2.text
.padding(.bottom)
L10n.quickConnectStep3.text
.padding(.bottom)
}
Text(code)
.tracking(10)

View File

@ -34,8 +34,8 @@ extension LiveVideoPlayer {
Spacer()
Overlay.LiveBottomBarView()
.padding2()
.padding2()
.padding()
.padding()
.background {
LinearGradient(
stops: [

View File

@ -44,8 +44,8 @@ extension VideoPlayer {
Spacer()
}
.padding2()
.padding2()
.padding()
.padding()
ScrollViewReader { proxy in
ScrollView(.horizontal) {
@ -90,8 +90,8 @@ extension VideoPlayer {
}
}
}
.padding2()
.padding2(.horizontal)
.padding()
.padding(.horizontal)
}
.onChange(of: currentOverlayType) { _, newValue in
guard newValue == .chapters else { return }

View File

@ -34,8 +34,8 @@ extension VideoPlayer {
Spacer()
VideoPlayer.Overlay.BottomBarView()
.padding2()
.padding2()
.padding()
.padding()
.background {
LinearGradient(
stops: [

View File

@ -1,5 +1,5 @@
{
"originHash" : "323b2ad9aaa9c000faf264d68272f0e9fab1349d9f910a0b95ee6aea10460f31",
"originHash" : "651194fc1966b57201a0de2cba27dc40798bbdf515febdc83f00d634d916fea4",
"pins" : [
{
"identity" : "blurhashkit",
@ -132,8 +132,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/kean/Pulse",
"state" : {
"revision" : "d1e39ffaaa8b8becff80cb193c93a78e32077af8",
"version" : "4.2.0"
"revision" : "3ac5ee35ab233e900aa484919803d51791d1e351",
"version" : "4.2.7"
}
},
{

View File

@ -23,17 +23,14 @@ struct QuickConnectView: View {
private func pollingView(code: String) -> some View {
VStack(alignment: .leading, spacing: 20) {
// TODO: change strings so that numbers are removed
// and use `BulletedList`
// - also probably rephrase/change steps
L10n.quickConnectStep1.text
L10n.quickConnectStep2.text
L10n.quickConnectStep3.text
.padding(.bottom)
BulletedList {
L10n.quickConnectStep1.text
.padding(.bottom)
L10n.quickConnectStep2.text
.padding(.bottom)
L10n.quickConnectStep3.text
.padding(.bottom)
}
Text(code)
.tracking(10)

View File

@ -43,8 +43,7 @@ extension LiveVideoPlayer {
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
}
.if(UIDevice.isPad) { view in
view.padding(.top)
.padding2(.horizontal)
view.padding()
}
.background {
LinearGradient(
@ -68,8 +67,7 @@ extension LiveVideoPlayer {
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
}
.if(UIDevice.isPad) { view in
view.padding2(.bottom)
.padding2(.horizontal)
view.padding()
}
.background {
LinearGradient(

View File

@ -44,7 +44,7 @@ extension VideoPlayer {
}
.if(UIDevice.isPad) { view in
view.padding(.top)
.padding2(.horizontal)
.padding(.horizontal)
}
.background {
LinearGradient(
@ -68,8 +68,8 @@ extension VideoPlayer {
.padding(.trailing, splitContentViewProxy.isPresentingSplitView ? 0 : safeAreaInsets.trailing)
}
.if(UIDevice.isPad) { view in
view.padding2(.bottom)
.padding2(.horizontal)
view.padding(.bottom)
.padding(.horizontal)
}
.background {
LinearGradient(

View File

@ -231,9 +231,9 @@
"quickConnectInvalidError" = "Invalid Quick Connect code";
"quickConnectSuccessMessage" = "Authorizing Quick Connect successful. Please continue on your other device.";
"showChaptersInfoInBottomOverlay" = "Show Chapters Info In Bottom Overlay";
"quickConnectStep1" = "1. Open the Jellyfin app on your phone or web browser and sign in with your account";
"quickConnectStep2" = "2. Open the user menu and go to the Quick Connect page";
"quickConnectStep3" = "3. Enter the following code:";
"quickConnectStep1" = "Open the Jellyfin app on your phone or web browser and sign in with your account";
"quickConnectStep2" = "Open the user menu and go to the Quick Connect page";
"quickConnectStep3" = "Enter the following code:";
"quickConnectNotEnabled" = "Note: Quick Connect not enabled";
"episodeNumber" = "Episode %1$@";
"compactPoster" = "Compact Poster";
@ -278,6 +278,7 @@
"grid" = "Grid";
"list" = "List";
"logs" = "Logs";
"likedItems" = "Liked Items";
"onNow" = "On Now";
"sports" = "Sports";