Add server URL to settings

This commit is contained in:
Shav Kinderlehrer 2024-01-08 08:26:46 -05:00
parent 1f25fa576d
commit ca47292e3d
3 changed files with 9 additions and 4 deletions

View File

@ -21,7 +21,6 @@ struct JelApp: App {
ContentView() ContentView()
.environmentObject(jellyfinClientController) .environmentObject(jellyfinClientController)
.task { .task {
URLCache.shared.diskCapacity = 1_000_000_000 // 1GB cache for images
AuthStateController.shared.load() AuthStateController.shared.load()
SettingsController.shared.load() SettingsController.shared.load()
jellyfinClientController.setUrl(url: AuthStateController.shared.serverUrl) jellyfinClientController.setUrl(url: AuthStateController.shared.serverUrl)

View File

@ -47,6 +47,7 @@ struct ItemMediaView<Content: View>: View {
} }
ItemGenresView(item: item) ItemGenresView(item: item)
.padding(.vertical)
} }
.if(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing) > 0) {view in .if(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing) > 0) {view in
view view

View File

@ -28,6 +28,11 @@ struct SettingsView: View {
.textSelection(.enabled) .textSelection(.enabled)
} }
LabeledContent("Server URL") {
Text("\(authState.serverUrl?.absoluteString ?? "---")")
.textSelection(.enabled)
}
Button(role: .destructive) { Button(role: .destructive) {
authState.loggedIn = false authState.loggedIn = false
authState.save() authState.save()
@ -81,6 +86,6 @@ struct SettingsView: View {
} }
} }
#Preview { //#Preview {
SettingsView(showingSettingsView: .constant(true)) // SettingsView(showingSettingsView: .constant(true))
} //}