2020-02-19 23:00:23 +00:00
|
|
|
//
|
|
|
|
// LiveUser.swift
|
|
|
|
// Music Tools
|
|
|
|
//
|
|
|
|
// Created by Andy Pack on 19/02/2020.
|
|
|
|
// Copyright © 2020 Sarsoo. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
class LiveUser: ObservableObject {
|
2020-02-22 13:28:15 +00:00
|
|
|
|
|
|
|
@Published var playlists: [Playlist]
|
|
|
|
@Published var tags: [Tag]
|
2020-02-19 23:00:23 +00:00
|
|
|
|
2020-02-20 18:25:28 +00:00
|
|
|
init(playlists: [Playlist], tags: [Tag]) {
|
2020-02-19 23:00:23 +00:00
|
|
|
self.playlists = playlists
|
2020-02-20 18:25:28 +00:00
|
|
|
self.tags = tags
|
2020-02-19 23:00:23 +00:00
|
|
|
}
|
2020-02-22 13:28:15 +00:00
|
|
|
|
|
|
|
func updatePlaylist(playlistIn: Playlist) {
|
|
|
|
guard let index = self.playlists.firstIndex(of: playlistIn) else {
|
|
|
|
fatalError("\(playlistIn) not found")
|
|
|
|
}
|
|
|
|
self.playlists[index] = playlistIn
|
|
|
|
}
|
2020-02-19 23:00:23 +00:00
|
|
|
}
|