The setRating function will probably not work for implementing the
“trackstat setrating” command due to this if statement:

Code:
--------------------
    
  if ($request->isNotCommand([['ratingslight'],['setrating']])) {
  
--------------------

You can do an “and” with a similar statement for isNotCommand with
trackstat setrating and it should work properly.

If you want to make it work properly if TrackStat also is installed you
could put an if statement around the addDispatch calls that register
TrackStat CLI commands so they are only registered if TrackStat isn’t
installed. You can see the isPluginsInstalled function in some of my
plugins for an example how to check if a plugin is installed. If you
want to have additional logic in setrating if TrackStat is installed you
can implement a setTrackStatRating function and TrackStat will call your
plugin when a rating is set through TrackStat, you can see the
TrackStatPlaylist plugin for an example of this
https://github.com/erland/lms-trackstatplaylist/blob/a00d709aaf2dbe797c096b949d3d4b280335fb44/src/Plugin.pm

Just mentioning all this since your logic around comment tags and
playlists generation potentially could be useful for someone even if
TrackStat is installed.

You might want to check with pippin how iPeng handles ratings, not sure
if it checks if trackstat setrating is available or explicitly checks if
TrackStat plugin is installed. Might be other third party apps that also
sets ratings via TrackStat that you might want to verify compatibility
with.

By the way, it’s great to see more third party developers are interested
to add functionality around ratings :-)



Erland Isaksson ('My homepage' (http://erland.isaksson.info))
Developer of 'many plugins/applets'
(https://wiki.slimdevices.com/index.php/User_Erland.html)
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=113344

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to