From ca47292e3d2ebb5024c8c9ebbe8211f2779a4a81 Mon Sep 17 00:00:00 2001 From: Shav Kinderlehrer Date: Mon, 8 Jan 2024 08:26:46 -0500 Subject: [PATCH] Add server URL to settings --- Jel/JelApp.swift | 1 - Jel/Views/Library/Item/ItemMediaView.swift | 1 + Jel/Views/Settings/SettingsView.swift | 11 ++++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Jel/JelApp.swift b/Jel/JelApp.swift index bb3fe1e..5dce28d 100644 --- a/Jel/JelApp.swift +++ b/Jel/JelApp.swift @@ -21,7 +21,6 @@ struct JelApp: App { ContentView() .environmentObject(jellyfinClientController) .task { - URLCache.shared.diskCapacity = 1_000_000_000 // 1GB cache for images AuthStateController.shared.load() SettingsController.shared.load() jellyfinClientController.setUrl(url: AuthStateController.shared.serverUrl) diff --git a/Jel/Views/Library/Item/ItemMediaView.swift b/Jel/Views/Library/Item/ItemMediaView.swift index c7fe0cb..2e6f133 100644 --- a/Jel/Views/Library/Item/ItemMediaView.swift +++ b/Jel/Views/Library/Item/ItemMediaView.swift @@ -47,6 +47,7 @@ struct ItemMediaView: View { } ItemGenresView(item: item) + .padding(.vertical) } .if(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing) > 0) {view in view diff --git a/Jel/Views/Settings/SettingsView.swift b/Jel/Views/Settings/SettingsView.swift index 6d246d1..174573d 100644 --- a/Jel/Views/Settings/SettingsView.swift +++ b/Jel/Views/Settings/SettingsView.swift @@ -28,6 +28,11 @@ struct SettingsView: View { .textSelection(.enabled) } + LabeledContent("Server URL") { + Text("\(authState.serverUrl?.absoluteString ?? "---")") + .textSelection(.enabled) + } + Button(role: .destructive) { authState.loggedIn = false authState.save() @@ -81,6 +86,6 @@ struct SettingsView: View { } } -#Preview { - SettingsView(showingSettingsView: .constant(true)) -} +//#Preview { +// SettingsView(showingSettingsView: .constant(true)) +//}