Using API to populate the Queue

I am trying to extract data from the music library in order to populate the queue with random albums (or artists or tracks).

So far, using bits of other people’s work, I have managed to ‘addToQueue’ albums using;

to read in the data.
(This line came from ‘A few useful node.js scripts’ in the Guides forum - many thanks to Jellby)

As far as sending artists and tracks to the queue…
Replacing ‘albums’ with ‘artists’ does work but not all the artists are ‘found’ during the ‘browse’(around 50%)?
Replacing ‘albums’ with ‘tracks’ or ‘songs’ does not work.

The only way I have managed to add tracks to the queue is to add an extra / to the line;

Thus. socket.emit(‘browseLibrary’,{‘uri’:///’});

This adds tracks but very few are found during the ‘browse’

I hope this makes sense, any help gratefully received!

After much tinkering I’m now able to ask the same question but in perhaps a more concise form.

How do I ‘browseLibrary’ to return a full uri for each track in the library?

Thanks for any help
David W.