Hi @ben
You helped me out on the APIs in the past. I don’t know whether you are still in charge of the APIs. if you are not, could you please forward this question.
I was looking at the roon’s browse api documentation at https://roonlabs.github.io/node-roon-api/RoonApiBrowse.html
And I saw the “multi_session_key” property. and from the description, it says
If your application browses several instances of the same hierarchy at the same time, you can populate this to distinguish between them. Most applications will omit this field.
I tried adding this to the call, but the returning item_key stays the same and i subsequent calls using the item_key and multi_session_key will result in “invalid key”.
Am i correct in understanding the multi_session_key is to have several browser/client to traverse the roon browse api independently? if so, could you please let me know how to call it properly?
Here’s my code:
calling refresh_browse (I added the multi_session_key to the opts array):
refresh_browse( req.query['zoneId'], { item_key: req.query['item_key'], input: req.query['toSearch'] , req.query['multiSessionKey] }, 0, 100, function(myList) { ... }
and on refresh_browse:
function refresh_browse(zone_id, opts, page, listPerPage, cb) {
var items = [];
opts = Object.assign({
hierarchy: "browse",
zone_or_output_id: zone_id,
}, opts);
core.services.RoonApiBrowse.browse(opts, (err, r) => {
if (err) { console.log(err, r); return; }
if (r.action == 'list') {
page = ( page - 1 ) * listPerPage;
core.services.RoonApiBrowse.load({
hierarchy: "browse",
offset: page,
set_display_offset: listPerPage,
}, (err, r) => {
items = r.items;
cb(r.items);
});
}
});
}
Thank you very much for your help.
Bastian