Bug 17357 - Converting from a "contextmenu" menu to an "*info" menu doesn't carry forward connectionID
: Converting from a "contextmenu" menu to an "*info" menu doesn't carry forward...
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: CLI
: 7.6.0
: PC Other
: -- normal with 1 vote (vote)
: 7.6.1
Assigned To: Adrian Smith
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-27 16:12 UTC by Joerg Schwieder
Modified: 2011-08-02 13:08 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Schwieder 2011-07-27 16:12:10 UTC
Symptom: There is some issue with iPeng and the "On Spotify" menu.
The reason seems to be that iPeng uses "contextmenu" to call the initial context menu for an artist or album (for backwards compatibility) while SqueezePlay does not (in 7.6).

SqueezePlay fetches this as the context menu:
 
[11-07-27 23:20:30.3683] Slim::Web::Cometd::handler (149) Cometd request (10.0.0.4:34582): [
  {
    channel => "/slim/request",
    data => {
          request  => [
                        "00:04:20:22:00:c0",
                        [
                          "artistinfo",
                          "items",
                          0,
                          200,
                          "xmlBrowseInterimCM:1",
                          "menu:1",
                          "artist_id:6703",
                          "useContextMenu:1",
                        ],
                      ],
          response => "/a5976bf2/slim/request",
        },
    id => 158,
  },
]
SqueezePad fetches this:
 
[11-07-27 23:25:49.9352] Slim::Web::Cometd::handler (149) Cometd request (192.168.1.101:54128): [
  {
    channel => "/slim/request",
    data => {
          request  => [
                        "00:04:20:06:08:c7",
                        [
                          "artistinfo",
                          "items",
                          0,
                          100,
                          "xmlBrowseInterimCM:1",
                          "artist_id:6703",
                          "menu:1",
                          "useContextMenu:1",
                        ],
                      ],
          response => "/1edf29eb/slim/request",
        },
    id => 16,
  },
]
iPeng fetches this:
 
[11-07-27 23:26:57.4590] Slim::Web::Cometd::handler (149) Cometd request (192.168.1.101:54183): [
  {
    channel => "/slim/request",
    data => {
          request  => [
                        "00:04:20:06:08:c7",
                        [
                          "contextmenu",
                          0,
                          100,
                          "userInterfaceIdiom:iPeng",
                          "menu:artist",
                          "artist_id:6704",
                          "useContextMenu:1",
                        ],
                      ],
          response => "/e7d1939c/slim/request",
        },
    id => 42,
  },
]
This requires the server to pass though additional code to convert from the contextmenu request to an artistinfo request which does not carry forward the connectionID within the server.  The context menu code I added for caching state which is what is needed to make the Spotify plugin (and probably others) work needs this...
 
So needs an iPeng change or a server change....  Server change would probably be something like this:
 
Index: Slim/Control/Queries.pm
===================================================================
--- Slim/Control/Queries.pm     (revision 32886)
+++ Slim/Control/Queries.pm     (working copy)
@@ -4447,8 +4447,10 @@
        if (defined($menu)) {
                # send the command to *info, where * is the param given to the menu command
                my $command = $menu . 'info';
-               $proxiedRequest = Slim::Control::Request::executeRequest( $client, [ $command, 'items', $index, $quantity, @requestParams ] );
-
+               $proxiedRequest = Slim::Control::Request->new( $client->id, [ $command, 'items', $index, $quantity, @requestParams ] );
+               $proxiedRequest->connectionID( $request->connectionID );
+               $proxiedRequest->execute();
+
                # Bug 13744, wrap async requests
                if ( $proxiedRequest->isStatusProcessing ) {
                        $proxiedRequest->callbackFunction( sub {
Comment 1 Erland Isaksson 2011-07-27 20:17:22 UTC
I can confirm that the provided patch solves the problem I had with the "On Spotify" menu in iPeng. 

Let me know if there is a need to run more extensive testing of the changes and in that case which area I should test.
Comment 2 SVN Bot 2011-07-28 10:27:37 UTC
 == Auto-comment from SVN commit #32925 to the slim repo by adrian ==
 == http://svn.slimdevices.com/slim?view=revision&revision=32925 ==

Bug: 17357
Description: propogate the connection id as this is required for caching within the info handlers