gmusicapi
gmusicapi copied to clipboard
Clarify where different ids can be used
trafficstars
For example, nid cannot be used for deleting or streaming tracks.
In case someone else runs into this. "nid" does seem to work for all-access track streaming, but not for uploaded songs. "id" works for everything, so using that is probably the best bet.
Just to throw some fun into it, it appears you can actually stream a library track using its nid if it was scanned and matched as it is different than the nid of the same song when uploaded.
I've gotten this question a few times recently, so here's a quick rundown I can point people to (and should probably be added to the docs):
id: a library id- unique inside a single user's library
- not present for tracks not added to the library (eg, store tracks directly added to a playlist)
- never changes
- works for most apis (streaming, adding to playlists, etc) with the exception of those explicitly expecting a store id; the preferred param when available
nid: a "nautilus" id (the codename for Google's music database)- unique inside Google's music database (which includes more tracks than those they have licensed for sale)
- not present for tracks Google can't identify
- changes occasionally
- doesn't work consistently for apis; should be avoided as a param
- generally not useful; can signal that a track was matched, but trackType has this information too
storeId: a store id, thenidfor tracks that Google sells- unique inside Google's store
- not present for tracks that Google doesn't sell
- changes occasionally
- works for all apis, but best used only for those that expect a store id, or as a backup when
idis not present