it looks like (one of) the latest public revision(s) changed how getTemporaryCopy works. Previously, I could do something like this:
Code: Select all
var currentTrack = app.player.getCurrentTrack();
var copy = currentTrack.getTemporaryCopy();
I suppose I could use getTemporaryCopies instead, but wrapping a track it in a tracklist, making a copy of said list and finally extracting a copy of the original track seems kinda hacky if I only have one track to begin with.
So, does anybody have any hints on how to use getTemporaryCopy or any other method to copy a track object that doesn't just return a reference to the original object but actually creates a new one?
Edit:
Having a look at my original function, maybe I'm overthinking this:
Code: Select all
if (track.artist !== newArtist) {
let newTrack = track.getTemporaryCopy()
newTrack.artist = newArtist
track.assign(newTrack)
}
Edit 2:
Yes, just assigning a new value to track.artist works fine and doesn't have any negative side effects (that I could find), so I'll just use that. Out of curiosity I sill wonder how getTemporaryCopy should be used, though.