Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 5 of 5

Thread: JSONRPC queries

  1. #1
    Junior Member
    Join Date
    Mar 2017
    Posts
    23

    JSONRPC queries

    I’m developing a material style skin for LMS (using vue.js and vuetify.js). It’s not yet ready for serious use – as it has a few missing details such as sync and editing of the play queue (had a working version, but mobile browsers don’t support HTML5 drag’n’drop).

    For the music browsing side, I have most things working – at least what I mainly use; artists, genres, radios, apps, etc. However a few things have me stumped.

    1. How do I add an Artist, Album, or Genre to favourites? I thought [“favorites”, “add”, “artist_id:XXXX”, “title:ArtistName”] would work – but it does not. If I use the current web UI to add an artist as a favourite, then list this via ["favorites","items", 0,20, "want_url:1"] it returns {"id":"3","name":"Artist Name","type":"playlist","isaudio":1,"hasitems":1} And the web UI can navigate into this. How does this work?

    2. How do I get a TuneIn, Artist, or Album image for a favorite?

    3. I’d like to add configuring of the “Don’t stop the music” plugin – as this is one I use a lot. How do I get a list of the installed plugins? I can see the JSONRPC call to get a plugins config, and change it. But how can I check if a plugin is installed? For the DSTM plugin, how can I get a list of of its options (e.g. LastMix, etc) ?

    Thanks for any help.

    If anyone is interested, the code and current screenshots are at: https://github.com/CDrummond/lms-material

  2. #2
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    763
    Quote Originally Posted by cpd73 View Post
    1. How do I add an Artist, Album, or Genre to favourites? I thought [“favorites”, “add”, “artist_id:XXXX”, “title:ArtistName”] would work – but it does not. If I use the current web UI to add an artist as a favourite, then list this via ["favorites","items", 0,20, "want_url:1"] it returns {"id":"3","name":"Artist Name","type":"playlist","isaudio":1,"hasitems":1} And the web UI can navigate into this. How does this work?
    Note: this is from my own research, I haven't found any official docs..
    These are XMLBrowser based queries, which are designed for context menus / tree structures etc.. Items in the tree have an id, which "represents the hierarchical structure [...] using a dotted syntax similar to the one used in SNMP, like eg. 2.0.9.3."
    You'll need to provide an item_id with favorites add, which specifies where to add the favorite.
    With the 'favorites', 'items' query, you'll get those item ids.

    Or you can simply show the context menu in your UI and let LMS handle the logic (see the {track/artist/genre/album/folder/playlist/year}info queries)

    How do I get a list of the installed plugins?
    Use the systeminfo query

    But how can I check if a plugin is installed?
    Use a query like "can","dontstopthemusic", "dontstopthemusicsetting","?" to check for a specific plugin (command)

    For the DSTM plugin, how can I get a list of of its options (e.g. LastMix, etc) ?
    Use "dontstopthemusic", "dontstopthemusicsetting"
    Details see here

  3. #3
    Junior Member
    Join Date
    Mar 2017
    Posts
    23
    Thanks for the reply.

    I’ve already discovered the xmlbrowser stuff, but thanks. It was what URL to use when adding an artist, or album, from the local library. However, I’ve just noticed that if I go into editing a favorite as set by the web UI, I can see that it uses db:album.title=AlbumName as the URL to save an album as a favortite. So I can use this. Not sure how the web UI then gets the cover, but I can dig some more.

    Can’t find any systeminfo query – searched the CLI docs.

    As to DSTM, its the list of available options that I’d like to see – so I can show them in the UI. I know that ["playerpref", "plugin.dontstopthemusic : provider", "?"] shows the current setting – but I need the list of options (plus a mapping of this setting value to textual string).

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,084
    If you want to have the best support for the existing menus, you should invest in SlimMenu/SlimBrowse (http://wiki.slimdevices.com/index.ph...Play_interface). It's not an easy task, but would automatically give you all the menus there are. Otherwise there's no reliable method to get all the features you see in the menus.
    Michael

    http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo

  5. #5
    Junior Member
    Join Date
    Mar 2017
    Posts
    23
    I've managed to get favourites working - with the exception of images. But good enough for now.

    As for DSTM, ["xx:xx:xx:xx:xx:xx", ["dontstopthemusicsetting",0,1]] provides exactly what I was looking for :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •