mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 14:52:03 +00:00
Remove Test Connection from source editing
The Test Connection buttons only probed API/server reachability, which was misleading: a green result said nothing about whether videos would actually play. Remove both the remote-server and WebDAV bandwidth test buttons and all code exclusive to them (testBandwidth, BandwidthTestResult, and orphaned localization keys). Add-time connectivity validation for SMB/WebDAV sources is retained.
This commit is contained in:
@@ -11,8 +11,6 @@ import SwiftUI
|
||||
|
||||
/// Result of a connection test for WebDAV/SMB sources.
|
||||
enum SourceTestResult {
|
||||
case success
|
||||
case successWithBandwidth(BandwidthTestResult)
|
||||
case failure(String)
|
||||
}
|
||||
|
||||
@@ -25,38 +23,6 @@ struct SourceTestResultSection: View {
|
||||
var body: some View {
|
||||
Section {
|
||||
switch result {
|
||||
case .success:
|
||||
Label(String(localized: "sources.status.connected"), systemImage: "checkmark.circle.fill")
|
||||
.foregroundStyle(.green)
|
||||
|
||||
case .successWithBandwidth(let bandwidth):
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Label(String(localized: "sources.status.connected"), systemImage: "checkmark.circle.fill")
|
||||
.foregroundStyle(.green)
|
||||
if bandwidth.hasWriteAccess {
|
||||
if let upload = bandwidth.formattedUploadSpeed {
|
||||
Label(String(localized: "sources.bandwidth.upload \(upload)"), systemImage: "arrow.up.circle")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
if let download = bandwidth.formattedDownloadSpeed {
|
||||
Label(String(localized: "sources.bandwidth.download \(download)"), systemImage: "arrow.down.circle")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
if !bandwidth.hasWriteAccess {
|
||||
Label(String(localized: "sources.status.readOnly"), systemImage: "lock.fill")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.orange)
|
||||
}
|
||||
if let warning = bandwidth.warning {
|
||||
Text(warning)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
|
||||
case .failure(let error):
|
||||
Label(error, systemImage: "xmark.circle.fill")
|
||||
.foregroundStyle(.red)
|
||||
|
||||
Reference in New Issue
Block a user