gmusicapi icon indicating copy to clipboard operation
gmusicapi copied to clipboard

Clarify where different ids can be used

Open simon-weber opened this issue 11 years ago • 3 comments
trafficstars

For example, nid cannot be used for deleting or streaming tracks.

simon-weber avatar Jun 13 '14 21:06 simon-weber

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.

jamon avatar Nov 24 '14 00:11 jamon

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.

thebigmunch avatar Sep 14 '16 10:09 thebigmunch

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, the nid for 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 id is not present

simon-weber avatar Nov 04 '17 19:11 simon-weber