MusicMatchModel
final class MusicMatchModel : ObservableObject, @unchecked Sendable
The model for MusicMatchView
-
The status of matching songs between Kodi and Music
Declaration
Swift
@Published var status: Status { get set }
-
Matching progress values
Declaration
Swift
@Published var progress: Progress { get set }
-
Setting which ratings will be used
Declaration
Swift
@AppStorage var ratingAction: MusicMatchModel.RatingAction { get set }
-
Setting which playcount will be used
Declaration
Swift
@AppStorage var playcountAction: MusicMatchModel.PlaycountAction { get set }
-
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
-
getKodiSongs()
AsynchronousGet 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
-
matchSongs()
AsynchronousMatch songs between Kodi and Music
Declaration
Swift
func matchSongs() async
-
syncAllSongs()
AsynchronousSync all songs between Kodi and Music
Declaration
Swift
func syncAllSongs() async
-
syncSong(song:
Asynchronous)
-
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
-
setMusicMatchCache()
AsynchronousStore 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