Skip to content

CLI commands

AF-1 edited this page Aug 16, 2022 · 7 revisions

The setrating command

  • ['ratingslight', 'setrating', 'trackid', 'rating', 'incremental']
    The setrating command expects a rating value in the range of 0 to 5. Half-star ratings like 3.5 are supported. Use a decimal point, not a comma.
  • ['ratingslight', 'setratingpercent', 'trackid', 'rating', 'incremental']
    The setratingpercent command expects a rating value in the range of 0 to 100.

Example:
The command ['ratingslight', 'setrating', 'track_id:12345', 'rating:3.5'] will store a rating value of 70 (3.5 stars * 20) in the database for the track with the track_id:12345.


Incremental rating

Use the incremental parameter with + or - to add/subtract a rating value to/from the current rating value.

Example 1:
The command ['ratingslight', 'setrating', 'track_id:12345', 'rating:1', 'incremental:+'] will add 1 star to the current rating value of the track with the track_id:12345.

Example 2:
You could use incremental rating changes with the KidsPlay plugin. Map this command to a button on your Boom or Radio to increase the current track's rating by 1 star (replace + with - to decrease rating):
ratingslight setrating track_id:{CURRENT_TRACK_ID} rating:1 incremental:+;




Subscribing to rating changes

You can also get notified of track rating changes in plugins and applets by subscribing to

  • applets: /slim/ratingslightchangedratingupdate
  • plugins: ['ratingslight', 'changedrating']
Clone this wiki locally