KodiConnector
public final class KodiConnector : ObservableObject
The Observable Class that provides the connection with a remote host (SwiftlyKodi Type)
-
The shared instance of this KodiConnector class
Declaration
Swift
public static let shared: KodiConnector
-
The host properties
Declaration
Swift
public var properties: Application.Property.Value
-
Bool if the host is scanning content
Note
Used to stop Notifications and Library updates or else the Host and the KodiConnector get nutsDeclaration
Swift
public var scanningLibrary: Bool
-
The status of the KodiConnector class
Declaration
Swift
@Published public var status: Status { get set }
-
The remote host to make a connection
Declaration
Swift
@Published public var host: HostItem { get set }
-
The library on the Kodi host
Declaration
Swift
@Published public var library: Library.Items { get set }
-
The host settings
Declaration
Swift
@Published public var settings: [Setting.Details.KodiSetting] { get set }
-
The addons
Declaration
Swift
public var addons: [Addon.Details]
-
The favourites
Declaration
Swift
@Published public var favourites: [any KodiItem] { get set }
-
The online hosts
Declaration
Swift
@Published public var bonjourHosts: [BonjourHost] { get set }
-
The configured hosts
Declaration
Swift
@Published public var configuredHosts: [HostItem] { get set }
-
Struct for a Kodi host found by the Bonjour browser
See moreDeclaration
Swift
struct BonjourHost : Equatable, Hashable, Identifiable
-
Get the last selected host, if any, and try connect to it
Declaration
Swift
public func getSelectedHost()
-
loadLibrary(cache:
Asynchronous) Load the library
Declaration
Swift
@MainActor public func loadLibrary(cache: Bool = true) async
Parameters
cache
Bool if it should try to load the library from the cache
-
getFavourites()
AsynchronousGet Favourites
Note
Only ‘real’ media’ is supportedDeclaration
Swift
public func getFavourites() async -> [any KodiItem]
Return Value
All ‘media’ favourites
-
Get a Kodi Setting
Declaration
Swift
public func getKodiSetting(id: Setting.ID) -> KodiSetting
Parameters
id
The ID of the setting
Return Value
The setting values
-
Simplified struct for a kodi setting
See moreDeclaration
Swift
public struct KodiSetting
-
Set the state of the KodiConnector and act on it
Declaration
Swift
@MainActor public func setStatus(_ current: Status)
-
The status of the KodiConnector
See moreDeclaration
Swift
public enum Status
-
getAudioLibraryUpdates()
AsynchronousGet the audio library updates
Declaration
Swift
@MainActor public func getAudioLibraryUpdates() async