shinedou wrote: 
> 
> > 
Code:
--------------------
  >   >     {
  > "title":"Artist Radio",
  > "script":"lmsCommand('$ID', ['dynamicplaylist', 'playlist', 'play', 
'dpldefault_zz_CONTEXTMENU_for_selected_artist_a01_songs_random', 
'dynamicplaylist_parameter_1:$ARTISTID']); setTimeout(() => lmsCommand('$ID', 
['dynamicplaylist', 'playlist', 'stop']), 10000)",
  > "icon":"queue_music"
  > },
--------------------
> > 

I -think- the replacement of "$ID" only works for the fist occurance -
will fix for next release. For now, however, you could just use a
variable. e.g. (untested):


Code:
--------------------
    
  {
  "title":"Artist Radio",
  "script":"let artistRadioId=$ID; lmsCommand(artistRadioId, 
['dynamicplaylist', 'playlist', 'play', 
'dpldefault_zz_CONTEXTMENU_for_selected_artist_a01_songs_random', 
'dynamicplaylist_parameter_1:$ARTISTID']); setTimeout(() => 
lmsCommand(artistRadioId, ['dynamicplaylist', 'playlist', 'stop']), 10000)",
  "icon":"queue_music"
  }
  
--------------------


To wait until a command finishes you should use:

Code:
--------------------
    
  lmsCommand('', [...]).then(({data}) => {
  // Next command here...
  });
  
--------------------



*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

Reply via email to