MusicMatchModel
final class MusicMatchModel: ObservableObject, @unchecked Sendable
The model for MusicMatchView
-
Undocumented
Declaration
Swift
init(kodi: KodiConnector)
-
The status of matching songs between Kodi and Music
Declaration
Swift
var status: Status = .none
-
Matching progress values
Declaration
Swift
var progress: Progress = .init(total: 0, current: 0)
-
Setting which ratings will be used
Declaration
Swift
var ratingAction: MusicMatchModel.RatingAction = .useKodiRating
-
Setting which playcount will be used
Declaration
Swift
var playcountAction: MusicMatchModel.PlaycountAction = .useKodiPlaycount
-
The items to match
Declaration
Swift
var musicMatchItems: [MusicMatchModel.Item] = []
-
The optional cache of the Music Match
Declaration
Swift
var cache: [MusicMatchModel.Item]?
-
The MusicBridge class
Declaration
Swift
let musicBridge = MusicBridge()
-
The current host
Declaration
Swift
let kodi: KodiConnector
-
Get all songs from Kodi
Declaration
Swift
private func getKodiSongs() async
-
Get all songs from Music
Declaration
Swift
private func getMusicSongs() -> [ITLibMediaItem]
Return Value
All songs from the Music database
-
Match songs between Kodi and Music
Declaration
Swift
func matchSongs() async
-
Sync all songs between Kodi and Music
Declaration
Swift
func syncAllSongs() async
-
Calculate the sync rating
Declaration
Swift
private func calculateRatingValue(item: MusicMatchModel.Item) -> Int
Parameters
item
The Music Match Item
Return Value
The rating
-
Set the progress values for the
MusicMatchView
Declaration
Swift
func setProgress(total: Double? = nil, current: Double? = nil)
Parameters
total
The total items
current
The current item
-
Store the Match struct in cache
Declaration
Swift
func setMusicMatchCache() async
-
The status of song matching
See moreDeclaration
Swift
enum Status: String
-
Which rating to use for syncing
See moreDeclaration
Swift
enum RatingAction: String, CaseIterable
-
Which playcount to use for syncing
See moreDeclaration
Swift
enum PlaycountAction: String, CaseIterable
-
A Music Match Item
See moreDeclaration
Swift
struct Item: Codable, Identifiable, Equatable
-
The sync values of an Item (Kodi or Music song)
See moreDeclaration
Swift
struct Values: Codable, Equatable
-
Progress values of matching
See moreDeclaration
Swift
struct Progress