doodooaudio wrote:
> Is it possible to add the tracknumber variable to the custom api for
> json?
Not currently, as Material does not store the track number - but I could
easily add. This would just be a number though, and not 0 padded.
doodooaudio wrote:
>
> I have also tried the following without success, I think the concept is
> correct but I don't know how to implement it.
>
> lmsresponse=lmsCommand('d0:63:b4:00:66:d0',['status','-','1','tags:u']);
> urlfile=lmsresponse.data.result.playlist_loop[0].url;
> dir=urlfile.substring(24,urlfile.lastIndexOf('/')+1);
> tracknum=urlfile.substr(urlfile.lastIndexOf('/')+1,2)
'lmsCommand returns a 'promise' so you have to wait for it. e.g.
Code:
--------------------
lmsCommand('d0:63:b4:00:66:d0',['status','-','1','tags:u']).then(({data}) => {
let urlfile=data.result.playlist_loop[0].url;
//....
});
--------------------
You handle the response of 'lmsCommand' in the 'then(...)' block.
To demonstrate, if you had the following:
Code:
--------------------
console.log('Start');
lmsCommand('d0:63:b4:00:66:d0',['status','-','1','tags:u']).then(({data}) => {
console.log('Response');
});
console.log('End')
--------------------
You would see the following logged to the console tab:
Code:
--------------------
Start
End
Response
--------------------
*Material debug:* 1. Launch via http: //SERVER:9000/material/?debug=json
(Use http: //SERVER:9000/material/?debug=json,cometd to also see update
messages, e.g. play queue) 2. Open browser's developer tools 3. Open
console tab in developer tools 4. REQ/RESP messages sent to/from LMS
will be logged here.
------------------------------------------------------------------------
cpd73's Profile: http://forums.slimdevices.com/member.php?userid=66686
View this thread: http://forums.slimdevices.com/showthread.php?t=109624
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins