summaryrefslogtreecommitdiff
path: root/Jel/Controllers/JellyfinClientController.swift
blob: 343efe1a211bf7c9098e19fb2804e2f44211ed0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
  }
}