diff options
author | Shav Kinderlehrer <[email protected]> | 2023-12-12 01:22:43 -0500 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2023-12-12 01:26:00 -0500 |
commit | 5ed7d2551ccaefc19d9e0b934ef17583dca202b2 (patch) | |
tree | 1c7853d57b0366f33356506c01b89d5955047c06 /Jel/Controllers/JellyfinClientController.swift | |
parent | 8a2b75dbfa85b89964848d4d2673e35cc6eed078 (diff) | |
download | jel-5ed7d2551ccaefc19d9e0b934ef17583dca202b2.tar.gz jel-5ed7d2551ccaefc19d9e0b934ef17583dca202b2.zip |
Add server page
Diffstat (limited to 'Jel/Controllers/JellyfinClientController.swift')
-rw-r--r-- | Jel/Controllers/JellyfinClientController.swift | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Jel/Controllers/JellyfinClientController.swift b/Jel/Controllers/JellyfinClientController.swift new file mode 100644 index 0000000..343efe1 --- /dev/null +++ b/Jel/Controllers/JellyfinClientController.swift @@ -0,0 +1,30 @@ +// +// JellyfinClientController.swift +// Jel +// +// Created by zerocool on 12/12/23. +// + +import Foundation +import Get +import JellyfinKit + +class JellyfinClientController { + let api: APIClient + + init(serverUrl: URL) { + self.api = APIClient( + baseURL: serverUrl + ) + } + + func isJellyfinServer() async -> Bool { + let request = Paths.getPublicUsers + do { + try await api.send(request) + } catch { + return false + } + return true + } +} |