mirror of
https://github.com/yattee/yattee.git
synced 2025-11-12 21:28:42 +00:00
Fix all SwiftLint violations across codebase
Resolves 130+ violations including deployment target checks, code style issues, and formatting inconsistencies. Adds SwiftLint disable comments for compiler-required availability checks while maintaining deployment target compliance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -84,13 +84,14 @@ struct AdvancedSettings: View {
|
||||
Text("cache-pause-initial")
|
||||
#if !os(tvOS)
|
||||
Image(systemName: "link")
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.font(.footnote)
|
||||
#if os(iOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-pause-initial")!)
|
||||
}
|
||||
#elseif os(macOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-pause-initial")!)
|
||||
}
|
||||
@@ -104,13 +105,14 @@ struct AdvancedSettings: View {
|
||||
Text("cache-secs")
|
||||
#if !os(tvOS)
|
||||
Image(systemName: "link")
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.font(.footnote)
|
||||
#if os(iOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-secs")!)
|
||||
}
|
||||
#elseif os(macOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-secs")!)
|
||||
}
|
||||
@@ -130,13 +132,14 @@ struct AdvancedSettings: View {
|
||||
Text("cache-pause-wait")
|
||||
#if !os(tvOS)
|
||||
Image(systemName: "link")
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.font(.footnote)
|
||||
#if os(iOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-pause-wait")!)
|
||||
}
|
||||
#elseif os(macOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-cache-pause-wait")!)
|
||||
}
|
||||
@@ -157,13 +160,14 @@ struct AdvancedSettings: View {
|
||||
Text("deinterlace")
|
||||
#if !os(tvOS)
|
||||
Image(systemName: "link")
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.font(.footnote)
|
||||
#if os(iOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-deinterlace")!)
|
||||
}
|
||||
#elseif os(macOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-deinterlace")!)
|
||||
}
|
||||
@@ -178,13 +182,14 @@ struct AdvancedSettings: View {
|
||||
Text("initial-audio-sync")
|
||||
#if !os(tvOS)
|
||||
Image(systemName: "link")
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.font(.footnote)
|
||||
#if os(iOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-initial-audio-sync")!)
|
||||
}
|
||||
#elseif os(macOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-initial-audio-sync")!)
|
||||
}
|
||||
@@ -199,13 +204,14 @@ struct AdvancedSettings: View {
|
||||
|
||||
#if !os(tvOS)
|
||||
Image(systemName: "link")
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.font(.footnote)
|
||||
#if os(iOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-hwdec")!)
|
||||
}
|
||||
#elseif os(macOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-hwdec")!)
|
||||
}
|
||||
@@ -228,13 +234,14 @@ struct AdvancedSettings: View {
|
||||
|
||||
#if !os(tvOS)
|
||||
Image(systemName: "link")
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.font(.footnote)
|
||||
#if os(iOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
UIApplication.shared.open(URL(string: "https://mpv.io/manual/stable/#options-demuxer-lavf-probe-info")!)
|
||||
}
|
||||
#elseif os(macOS)
|
||||
.accessibilityAddTraits([.isButton, .isLink])
|
||||
.onTapGesture {
|
||||
NSWorkspace.shared.open(URL(string: "https://mpv.io/manual/stable/#options-demuxer-lavf-probe-info")!)
|
||||
}
|
||||
|
||||
@@ -221,12 +221,12 @@ struct HistorySettings: View {
|
||||
.labelStyle(.iconOnly)
|
||||
.padding(7)
|
||||
.foregroundColor(limitRecents ? .accentColor : .gray)
|
||||
.accessibilityAddTraits(.isButton)
|
||||
#if os(iOS)
|
||||
.frame(minHeight: 35)
|
||||
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
|
||||
#endif
|
||||
.contentShape(Rectangle())
|
||||
.accessibilityAddTraits(.isButton)
|
||||
.onTapGesture {
|
||||
value.wrappedValue -= 1
|
||||
}
|
||||
@@ -253,11 +253,11 @@ struct HistorySettings: View {
|
||||
.labelStyle(.iconOnly)
|
||||
.padding(7)
|
||||
.foregroundColor(limitRecents ? .accentColor : .gray)
|
||||
.accessibilityAddTraits(.isButton)
|
||||
#if os(iOS)
|
||||
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
|
||||
#endif
|
||||
.contentShape(Rectangle())
|
||||
.accessibilityAddTraits(.isButton)
|
||||
.onTapGesture {
|
||||
value.wrappedValue += 1
|
||||
}
|
||||
|
||||
@@ -287,11 +287,11 @@ struct FavoriteItemEditorButton<LabelView: View>: View {
|
||||
.padding(7)
|
||||
.frame(minWidth: 40, minHeight: 40)
|
||||
.foregroundColor(color)
|
||||
.accessibilityAddTraits(.isButton)
|
||||
#if os(iOS)
|
||||
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(color))
|
||||
#endif
|
||||
.contentShape(Rectangle())
|
||||
.accessibilityAddTraits(.isButton)
|
||||
.onTapGesture(perform: onTapGesture)
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ struct PlayerControlsSettings: View {
|
||||
Text("System controls buttons")
|
||||
.font(.headline)
|
||||
.padding(.vertical, 8)
|
||||
|
||||
|
||||
Button(action: { systemControlsCommands = .seek }) {
|
||||
HStack {
|
||||
Text(labelText("Seek".localized()))
|
||||
@@ -170,8 +170,8 @@ struct PlayerControlsSettings: View {
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.padding(.vertical, 4)
|
||||
|
||||
Button(action: {
|
||||
|
||||
Button(action: {
|
||||
systemControlsCommands = .restartAndAdvanceToNext
|
||||
player.updateRemoteCommandCenter()
|
||||
}) {
|
||||
@@ -301,12 +301,12 @@ struct PlayerControlsSettings: View {
|
||||
.labelStyle(.iconOnly)
|
||||
.padding(7)
|
||||
.foregroundColor(.accentColor)
|
||||
.accessibilityAddTraits(.isButton)
|
||||
#if os(iOS)
|
||||
.frame(minHeight: 35)
|
||||
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
|
||||
#endif
|
||||
.contentShape(Rectangle())
|
||||
.accessibilityAddTraits(.isButton)
|
||||
.onTapGesture {
|
||||
var intValue = Int(value.wrappedValue) ?? 10
|
||||
intValue -= 5
|
||||
@@ -337,11 +337,11 @@ struct PlayerControlsSettings: View {
|
||||
.labelStyle(.iconOnly)
|
||||
.padding(7)
|
||||
.foregroundColor(.accentColor)
|
||||
.accessibilityAddTraits(.isButton)
|
||||
#if os(iOS)
|
||||
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
|
||||
#endif
|
||||
.contentShape(Rectangle())
|
||||
.accessibilityAddTraits(.isButton)
|
||||
.onTapGesture {
|
||||
var intValue = Int(value.wrappedValue) ?? 10
|
||||
intValue += 5
|
||||
|
||||
@@ -136,19 +136,9 @@ struct QualityProfileForm: View {
|
||||
|
||||
var formatsFooter: some View {
|
||||
VStack(alignment: .leading) {
|
||||
if #available(iOS 16.0, *) {
|
||||
Text("Formats can be reordered and will be selected in this order.")
|
||||
.foregroundColor(.secondary)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
} else if #available(iOS 14.0, *) {
|
||||
Text("Formats will be selected in the order they are listed.")
|
||||
.foregroundColor(.secondary)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
} else {
|
||||
Text("Formats will be selected in the order they are listed.")
|
||||
.foregroundColor(.secondary)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
Text("Formats can be reordered and will be selected in this order.")
|
||||
.foregroundColor(.secondary)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
|
||||
Text("**Note:** HLS is an adaptive format where specific resolution settings don't apply.")
|
||||
.foregroundColor(.secondary)
|
||||
@@ -252,15 +242,8 @@ struct QualityProfileForm: View {
|
||||
#if os(macOS)
|
||||
let list = filteredFormatList
|
||||
|
||||
Group {
|
||||
if #available(macOS 12.0, *) {
|
||||
list
|
||||
.listStyle(.inset(alternatesRowBackgrounds: true))
|
||||
} else {
|
||||
list
|
||||
.listStyle(.inset)
|
||||
}
|
||||
}
|
||||
list
|
||||
.listStyle(.inset(alternatesRowBackgrounds: true))
|
||||
Spacer()
|
||||
#else
|
||||
filteredFormatList
|
||||
|
||||
@@ -182,24 +182,14 @@ struct QualitySettings: View {
|
||||
}
|
||||
}
|
||||
|
||||
if #available(macOS 12.0, *) {
|
||||
#if os(macOS)
|
||||
List {
|
||||
list
|
||||
}
|
||||
.listStyle(.inset(alternatesRowBackgrounds: true))
|
||||
#else
|
||||
#if os(macOS)
|
||||
List {
|
||||
list
|
||||
#endif
|
||||
} else {
|
||||
#if os(macOS)
|
||||
List {
|
||||
list
|
||||
}
|
||||
#else
|
||||
list
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.listStyle(.inset(alternatesRowBackgrounds: true))
|
||||
#else
|
||||
list
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user