I am having slight issues using app.getObject. It appears like the only working filter for album objects is id. To illustrate:
Code: Select all
app.getObject('album', {id:232})
.then(album => album.id)
.then(albumID => app.getObject('album', {id:albumID}))
.then(album => console.log(album))
// object is returned here
app.getObject('album', {id:232})
.then(album => album.title)
.then(albumTitle => app.getObject('album', {title:albumTitle}))
.then(album => console.log(album))
// nothing is returned

I realize that you wouldn't usually use the promise chain like that, I only wanted to illustrate that filtering by album title doesn't work, even if the filter values are provided by the object itself, therefore ruling out typos. I tried the same with name, albumArtist and _persistentID, with the same result. The filter only works when using id.
Is it supposed to work like this or am I using the function incorrectly? In other words - if I have the name of an album and I want to get the tracklist for that album, how would I do that? I could probably get the album ID from getQueryResultAsync and then use that for getObject, but that seems to be a somewhat roundabout way of doing something that's (supposedly) straighforward to do.