Enhance download notifications and settings; add support for live activities
- Updated notification body to use proper German quotation marks for download failure alerts. - Refactored audio interruption handling in PlayerEngine to utilize MainActor.assumeIsolated for better performance. - Introduced nonisolated properties for support and downloads directories in ProgressSyncManager. - Improved FullHistoryView and MainView with additional toolbar items and alerts for download failures. - Added new toggles in SettingsView for parallel downloads and mobile data usage. - Created new color assets for the DownloadWidgetExtension and updated widget appearance. - Implemented Info.plist for DownloadWidgetExtension to support widget functionality. - Enabled live activities support in iOS Info.plist.
This commit is contained in:
@@ -63,6 +63,13 @@ struct FullHistoryView: View {
|
||||
Button(String(localized: "settings.done")) { dismiss() }
|
||||
}
|
||||
}
|
||||
#else
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(String(localized: "settings.done")) { dismiss() }
|
||||
.keyboardShortcut(.cancelAction)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
.overlay {
|
||||
if app.history.entries.isEmpty {
|
||||
@@ -77,6 +84,8 @@ struct FullHistoryView: View {
|
||||
#if os(iOS)
|
||||
.presentationDetents([.medium, .large])
|
||||
.presentationDragIndicator(.visible)
|
||||
#else
|
||||
.frame(minWidth: 480, minHeight: 560)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,21 @@ struct MainView: View {
|
||||
FullHistoryView()
|
||||
.environment(app)
|
||||
}
|
||||
#if os(iOS)
|
||||
.alert(
|
||||
"Download fehlgeschlagen",
|
||||
isPresented: Binding(
|
||||
get: { app.downloads.downloadFailureAlertTitle != nil },
|
||||
set: { if !$0 { app.downloads.downloadFailureAlertTitle = nil } }
|
||||
)
|
||||
) {
|
||||
Button("OK") { app.downloads.downloadFailureAlertTitle = nil }
|
||||
} message: {
|
||||
if let title = app.downloads.downloadFailureAlertTitle {
|
||||
Text("\u{201E}\(title)\u{201C} konnte nicht heruntergeladen werden.")
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
||||
@@ -10,6 +10,8 @@ struct SettingsView: View {
|
||||
@AppStorage("libraryLayout") private var layoutRaw: String = LibraryLayout.grid.rawValue
|
||||
@AppStorage("autoRefreshOnLaunch") private var autoRefreshOnLaunch: Bool = true
|
||||
@AppStorage("historyEnabled") private var historyEnabled: Bool = false
|
||||
@AppStorage("downloadsParallel") private var downloadsParallel: Bool = true
|
||||
@AppStorage("downloadsOverMobile") private var downloadsOverMobile: Bool = true
|
||||
|
||||
@State private var showLogoutConfirm: Bool = false
|
||||
@State private var showHistoryDisableConfirm: Bool = false
|
||||
@@ -226,10 +228,12 @@ struct SettingsView: View {
|
||||
Text("\(app.downloads.downloadedItems.count) Einträge")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
Toggle("Parallel herunterladen", isOn: $downloadsParallel)
|
||||
Toggle("Download über Mobilnetz erlauben", isOn: $downloadsOverMobile)
|
||||
} header: {
|
||||
Text("Downloads")
|
||||
} footer: {
|
||||
Text("Heruntergeladene Hörbücher und Folgen können einzeln über das Kontextmenü gelöscht werden.")
|
||||
Text("Parallel lädt alle Tracks eines Hörbuchs gleichzeitig — schneller, aber höhere Server- und Netzlast. Bei deaktiviertem Mobilnetz starten Downloads erst wenn WLAN verfügbar ist.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,8 +350,13 @@ struct SettingsView: View {
|
||||
|
||||
private var aboutPane: some View {
|
||||
Form {
|
||||
LabeledContent("Version", value: appVersion)
|
||||
LabeledContent("Heruntergeladen", value: "\(app.downloads.downloadedItems.count) Einträge")
|
||||
Section("Downloads") {
|
||||
Toggle("Parallel herunterladen", isOn: $downloadsParallel)
|
||||
LabeledContent("Heruntergeladen", value: "\(app.downloads.downloadedItems.count) Einträge")
|
||||
}
|
||||
Section("Über") {
|
||||
LabeledContent("Version", value: appVersion)
|
||||
}
|
||||
}
|
||||
.formStyle(.grouped)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user