Swift : iTunesLibrary : how to delete item from a playlist
I want to remove item from Songs in iTunes/Music.app programatically. I assume the correct playlist will be Music using allPlaylists.
I can get the playlist and its items with following code:
import iTunesLibrary
let itLib = try ITLibrary(apiVersion: "*")
itLib.allPlaylists.forEach { pl in
if pl.name == "Music" {
pl.items.forEach({ item in
print(item.title)
})
}
}
However, I don't know how to remove an item from the playlist.