Sort

public struct Sort : Codable, Equatable, Hashable

The sort fields for JSON requests (Global Kodi Type)

  • Init the sort order

    Declaration

    Swift

    public init(
        id: String = "ID",
        method: List.Sort.Method = .title,
        order: List.Sort.Order = .ascending,
        useartistsortname: Bool = true
    )
  • id

    The ID of the sort

    Note

    Not in use for KodiAPI but for internal sorting of KodiItems

    Declaration

    Swift

    public var id: String
  • The method

    Declaration

    Swift

    public var method: Method
  • The order

    Declaration

    Swift

    public var order: Order
  • Use artist sort name

    Declaration

    Swift

    public var useartistsortname: Bool

List.Sort.getMethods

List.Sort.buildKeyPathComparator

  • Build the sorting method and order for a KodiItem array

    Declaration

    Swift

    public static func buildKeyPathComparator(sortItem: List.Sort) -> [KeyPathComparator<any KodiItem>]

    Parameters

    sortItem

    The sorting

    Return Value

    An array with KeyPathComparator

List.Sort.Method

  • The sort method (SwiftlyKodi Type)

    See more

    Declaration

    Swift

    public enum Method : String, Codable, CaseIterable

List.Sort.Order

  • The sort order (SwiftlyKodi Type)

    See more

    Declaration

    Swift

    public enum Order : String, Codable, CaseIterable