Quantcast
Channel: Squeezebox : Community : Forums - Logitech Media Server
Viewing all articles
Browse latest Browse all 5300

Retrieving "My Apps" from the server

$
0
0
Or, "How do "apps" CLI queries work and how do they relate to the "My Apps" section of the server's web interface?"

Hello all -- I'm one of the primary developers of the Squeezer Android app, and I seek enlightenment on how best to support "My Apps" functionality in the app, as support for apps is one of the most frequently requested features.

For development and testing I have a Squeezebox Boom connected to the LMS running on a QNAP NAS (r7.7.2) and also an LMS instance on my development PC (r7.9.0). For testing multi-player scenarios I'll also run one or more SqueezePlay instances.

I have a mysqueezebox.com account, to which I have added two apps for the purposes of testing ("Absolute Radio UK" and "BBC").

If I connect to the web interface of either of the two LMS servers I can see the apps in the "My Apps" section of the web UI.

So far so good.

Squeezer users the CLI API to query the server. Reading the documentation the "apps" command appears to be the correct way to query for installed application plugins (?), so I connect to the server and run the following (">" == I send this, "<" == response back from LMS):


Code:

> apps 0 1
< apps 0 1 sort:weight count:14 icon:plugins/SpotifyLogi/html/images/icon.png cmd:spotifylogi weight:20 name:Spotify type:xmlbrowser
> apps 1 14
< apps 1 14 sort:weight count:14 icon:plugins/Napster/html/images/icon.png cmd:napster weight:25 name:Napster type:xmlbrowser
  icon:plugins/Deezer/html/images/icon.png cmd:deezer weight:35 name:Deezer type:xmlbrowser
  icon:plugins/Classical/html/images/icon.png cmd:classical weight:38 name:Classical.com type:xmlbrowser
  icon:plugins/MOG/html/images/icon.png cmd:mog weight:40 name:MOG type:xmlbrowser
  icon:plugins/LastFM/html/images/icon.png cmd:lfm weight:40 name:Last.fm%20Radio type:xmlbrowser
  icon:plugins/MP3tunes/html/images/icon.png cmd:mp3tunes weight:50 name:MP3tunes%20Music%20Locker type:xmlbrowser
  icon:plugins/Mediafly/html/images/icon.png cmd:mediafly weight:55 name:Mediafly type:xmlbrowser
  icon:plugins/LMA/html/images/icon.png cmd:lma weight:60 name:Live%20Music%20Archive type:xmlbrowser
  icon:http://www.mysqueezebox.com/static/images/icons/bbc.png cmd:bbc weight:1000 name:BBC type:xmlbrowser
  icon:http://www.mysqueezebox.com/static/images/icons/absolute.png cmd:absoluteradio weight:1000 name:Absolute%20Radio%20UK type:xmlbrowser
  icon:plugins/Sounds/html/images/icon.png cmd:sounds weight:1000 name:Sounds%20%26%20Effects type:xmlbrowser
  icon:plugins/Flickr/html/images/icon.png cmd:flickr weight:1000 name:Flickr type:xmlbrowser
  icon:plugins/Facebook/html/images/icon.png cmd:facebook weight:1000 name:Facebook type:xmlbrowser


(to make that easier to read I've unescaped the colons and the slashes in the paths (%3A -> :, %2F -> /) and added line breaks.

This confuses me:

1. There are more apps here than I expect. Where are these coming from? Is this from the "Plugins" tab of the server's configuration? If so, why are some plugins that are enabled on that tab (e.g., Pandora -- according to the plugins tab I have Pandora v3.0 plugin installed) not shown here?

2. Why aren't these plugins (e.g., Deezer) shown anywhere in the main web UI for the LMS? With my code in Squeezer I can select this plugin and play music with it, so it clearly works.

3. The official Logitech Android app only shows two apps when I tap its "My Apps" menu -- "Absolute Radio UK" and "BBC" (i.e., the two installed via mysqueezebox.com). Is it using another API call, or is using some heuristic to filter the list of plugins (e.g., only show ones where the icon URL does not start "plugins/")?

4. Some plugins appear to be using custom item types (undocumented as far as I can see) to try and request information from the user. For example, if I query for items from the Spotify plugin (which I think is different from the Spotify App at mysqueezebox.com) then I see


Code:

> 00:04:20:1e:38:c2 spotifylogi items 0 2
< 00:04:20:1e:38:c2 spotifylogi items 0 3
  title:Spotify%20Login id:bdd3b70c.0
  name:Thanks%20for%20installing%20Spotify!%20In%20order%20to%20use%20this%20app%2C%20you'll%20need%20a%20Spotify%20account.%20For%20more%20information%2C%20visit%20www.spotify.com.
  type:textarea isaudio:0 hasitems:1 id:bdd3b70c.1
  name:I%20have%20a%20Spotify%20account type:search title:Enter%20Spotify%20Username isaudio:0 hasitems:1 id:1f0bfafc.2
  name:I'm%20new%20to%20Spotify type:link isaudio:0 hasitems:1 count:3

and I can keep digging down that chain. I don't see anywhere in the LMS' web interface where I can configure the plugin with a username and password. Is this vestigal functionality that's no longer necessary with mysqueezebox.com and apps?

If it's not, are there agreed upon heuristics for parsing the different values of the "type" attribute? I've seen "textarea", "search", "text", and "link" so far.

Is there documentation somewhere that explains this? I've spent time on wiki.slimdevices.com, but couldn't find anything pertinent.

Viewing all articles
Browse latest Browse all 5300

Trending Articles