BrowserModel

class BrowserModel : ObservableObject

The model for BrowserView

  • The selection of optional genre, artist or album in the BrowserView

    Declaration

    Swift

    @Published
    var selection: BrowserModel.Selection { get set }
  • The state of loading the songs

    Declaration

    Swift

    @Published
    var state: AppState.State { get set }
  • Details for the ‘highest selected item’

    Declaration

    Swift

    var details: (any KodiItem)? { get }
  • All the items that are available

    Declaration

    Swift

    var library: BrowserModel.Media
  • The current Router selection

    Declaration

    Swift

    let router: Router
  • The optional search query

    Declaration

    Swift

    let query: String
  • Init the model with the current Router

    Declaration

    Swift

    init(router: Router, query: String)
  • The media to show in the BrowserView

    See more

    Declaration

    Swift

    struct Media : Equatable, Sendable
  • The optional selection in the BrowserView

    See more

    Declaration

    Swift

    struct Selection : Equatable, Hashable
  • filterLibrary() Asynchronous

    Filter the library by Router selection

    The browser library is based on songs; they are filtered first and then the rest is added

    Declaration

    Swift

    func filterLibrary() async
  • filterBrowser() Asynchronous

    Filter the BrowserView based on the optional Selection

    Declaration

    Swift

    func filterBrowser() async -> Media