// // Swiftfin is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, you can obtain one at https://mozilla.org/MPL/2.0/. // // Copyright (c) 2025 Jellyfin & Jellyfin Contributors // import Defaults import Factory import Foundation import JellyfinAPI // TODO: also have matching properties on `ServerState` that get/set values // MARK: keys extension StoredValues.Keys { static func ServerKey( _ name: String?, ownerID: String, domain: String, default defaultValue: Value ) -> Key { guard let name else { return Key(always: defaultValue) } return Key( name, ownerID: ownerID, domain: domain, default: defaultValue ) } static func ServerKey(always: Value) -> Key { Key(always: always) } } // MARK: values extension StoredValues.Keys { enum Server { static func publicInfo(id: String) -> Key { ServerKey( "publicInfo", ownerID: id, domain: "publicInfo", default: .init() ) } } }