From 9ccd37f754db33a190a9867bd5a310dfe5f4d17c Mon Sep 17 00:00:00 2001 From: Shav Kinderlehrer Date: Tue, 12 Dec 2023 17:12:58 -0500 Subject: Use System/Info/Public instead of Users/Public to verify server --- Jel.xcodeproj/project.pbxproj | 2 +- Jel/ContentView.swift | 30 -------------------------- Jel/Controllers/JellyfinClientController.swift | 2 +- Jel/Views/ContentView.swift | 30 ++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 Jel/ContentView.swift create mode 100644 Jel/Views/ContentView.swift diff --git a/Jel.xcodeproj/project.pbxproj b/Jel.xcodeproj/project.pbxproj index cc85edc..20b4838 100644 --- a/Jel.xcodeproj/project.pbxproj +++ b/Jel.xcodeproj/project.pbxproj @@ -108,6 +108,7 @@ 3D1015D72B27F54A00F5C29A /* Views */ = { isa = PBXGroup; children = ( + 3D9063CC2B279A310063DD2A /* ContentView.swift */, 3D91FDC52B28C28900919017 /* SignIn */, ); path = Views; @@ -160,7 +161,6 @@ 3D1015DF2B27F8EE00F5C29A /* Controllers */, 3D1015D72B27F54A00F5C29A /* Views */, 3D9063CA2B279A310063DD2A /* JelApp.swift */, - 3D9063CC2B279A310063DD2A /* ContentView.swift */, 3D9063CE2B279A320063DD2A /* Assets.xcassets */, 3D9063D02B279A320063DD2A /* Jel.entitlements */, 3D9063D12B279A320063DD2A /* Preview Content */, diff --git a/Jel/ContentView.swift b/Jel/ContentView.swift deleted file mode 100644 index 356615d..0000000 --- a/Jel/ContentView.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// ContentView.swift -// Jel -// -// Created by zerocool on 12/11/23. -// - -import SwiftUI - -struct ContentView: View { - @ObservedObject var authState: AuthStateController - var body: some View { - VStack { - if !authState.loggedIn { - SignInView(authState: authState) - } else { - Text("Logged in") - Button("Log out") { - authState.loggedIn = false - authState.save() - } - } - } - .padding() - } -} - -#Preview { - ContentView(authState: AuthStateController()) -} diff --git a/Jel/Controllers/JellyfinClientController.swift b/Jel/Controllers/JellyfinClientController.swift index b50157e..a80b908 100644 --- a/Jel/Controllers/JellyfinClientController.swift +++ b/Jel/Controllers/JellyfinClientController.swift @@ -60,7 +60,7 @@ class JellyfinClientController: ObservableObject { } func isJellyfinServer() async -> Bool { - let request = Paths.getPublicUsers + let request = Paths.getPublicSystemInfo do { let res = try await api.send(request) if res.statusCode != 200 { diff --git a/Jel/Views/ContentView.swift b/Jel/Views/ContentView.swift new file mode 100644 index 0000000..356615d --- /dev/null +++ b/Jel/Views/ContentView.swift @@ -0,0 +1,30 @@ +// +// ContentView.swift +// Jel +// +// Created by zerocool on 12/11/23. +// + +import SwiftUI + +struct ContentView: View { + @ObservedObject var authState: AuthStateController + var body: some View { + VStack { + if !authState.loggedIn { + SignInView(authState: authState) + } else { + Text("Logged in") + Button("Log out") { + authState.loggedIn = false + authState.save() + } + } + } + .padding() + } +} + +#Preview { + ContentView(authState: AuthStateController()) +} -- cgit v1.2.3