Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    406

    Determining Client Used During Plugin Access

    I am wondering if there is a way to query LMS when a plugin is being accessed by a client device to see what the UI is? For example is the native device being used, or an App like iPeng or Squeezer?

    I would like to know this so I can tailor the UI a bit for the specific client. For example I may want to put the plugin menu in a different place based on the client.
    Chris

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,536

    Determining Client Used During Plugin Access

    > I am wondering if there is a way to query LMS when a plugin is being
    > accessed by a client device to see what the UI is? For example is the
    > native device being used, or an App like iPeng or Squeezer?


    What kind of code is being called? A CLI command?

  3. #3
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    406
    My denonavpcontrol plugin written in perl.
    Chris

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,536

    Determining Client Used During Plugin Access

    > My denonavpcontrol plugin written in perl.

    Can you elaborate? How would the UIs interact with it?

  5. #5
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    406
    Let me explain my use case since it's pretty specific.

    For years I have been using:
    Slim::Control::Jive::registerPluginMenu(\@menu, 'settingsPlayer' ,$client);
    to install a menu in iPeng that the author assisted me in developing support for. However this location 'settingsPlayer' , is specific to iPeng and won't show on other apps.

    If I change the location to either 'extras' or 'settings' then this will work for other apps (confirmed with Squeezer). So my dilemma is how to tell which app (or at least if the app is iPeng or not) so I can put in an 'if' to install the menu appropriately.

    I suppose if there was some way to detect that the plugin failed to install the menu in 'settingsPlayer' I could then come back and attempt it in one of the other locations, but I am not aware of how to do that.
    Chris

  6. #6
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,536

    Determining Client Used During Plugin Access

    > For years I have been using:
    >> Slim::Control::Jive::registerPluginMenu(\@menu, 'settingsPlayer'
    >> ,$client); to install a menu in iPeng that the author assisted me in developing

    > support for. However this location 'settingsPlayer' , is specific to
    > iPeng and won't show on other apps.


    I would still need to know how the entries in that menu are being
    handled. Would you at any point have a $client object? If so you can
    check $client->controllerUA. That should give you the controller's "user
    agent string", none in the case of a web access, I believe. I sometimes
    use this to enable/disable features like eg. web links, depending on the
    controller.

  7. #7
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    406
    Yes. Client is accessed by
    my $client = $request->client();
    Is the $client->controllerUA just an attribute I can display in the log? If so I can experiment with both Squeezer and iPeng and see if they are discernable.

    EDIT:

    A quick try with
    my $client_controllerUA = $client->controllerUA;
    came up as null.
    Last edited by Aesculus; 2021-03-31 at 05:41.
    Chris

  8. #8
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,536

    Determining Client Used During Plugin Access

    > Is the $client->controllerUA just an attribute I can display in the log?
    > If so I can experiment with both Squeezer and iPeng and see if they are
    > discernable.


    Yes. Here's a regex I use to check whether one of those clients is being
    used:

    https://github.com/pierrepoulpe/Sque.../Plugin.pm#L23

  9. #9
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    406
    Quote Originally Posted by mherger View Post
    > Is the $client->controllerUA just an attribute I can display in the log?
    > If so I can experiment with both Squeezer and iPeng and see if they are
    > discernable.


    Yes. Here's a regex I use to check whether one of those clients is being
    used:

    https://github.com/pierrepoulpe/Sque.../Plugin.pm#L23
    That looks like I should be able to figure it out:

    Can you tell me why
    my $client_controllerUA = $client->controllerUA;
    came up as null (empty when in debug log).

    When I access $client by
    my $client = $request->client();
    Chris

  10. #10
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,536

    Determining Client Used During Plugin Access

    > Can you tell me why
    >> my $client_controllerUA = $client->controllerUA; came up as null (empty when in debug log).


    I think that's the case for web requests? What UI would you have used
    otherwise?

Posting Permissions

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