blob: bb3fe1e1a30d54098d10daeeb65e4668208d9d26 (
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
31
32
|
//
// JelApp.swift
// Jel
//
// Created by zerocool on 12/11/23.
//
import SwiftUI
@main
struct JelApp: App {
let jellyfinClientController = JellyfinClientController(authHeaders: AuthHeaders(
Client: "Jel",
Device: UIDevice.current.systemName,
DeviceId: UIDevice.current.identifierForVendor!.uuidString,
Version: Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0",
Token: ""))
var body: some Scene {
WindowGroup {
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)
jellyfinClientController.setToken(token: AuthStateController.shared.authToken ?? "")
}
}
}
}
|