Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Feb 2018

    Bad information displayed - Spotty plugin


    I am new on this forum. I have tried to search for a good title, maybe it is not the best title.

    I am french dude with not a perfect english, so i do apologize for my mistakes.

    I am coming on your forum because I am a user of LMS for one year now and I have an issue that I do not how to fix alone.

    First of all :
    LMS Version : Logitech Media Server Version: 7.9.1 - 1503129892 @ Thu Aug 31 04:39:14 UTC 2017
    Spotty plugin version : 2.1.9
    Spotty plugin configuratin :

    I hope i will be understandable :
    I am using a plugin on my web server which is managing my home-automation to control LMS (I am not the author of the plugin, you will see this soon, because of my poor dev skills ).

    This plugin is catching information from LMS to display those in a widget.

    If I start a playlist from spotty plugin, the display is good :

    LMS rendering (right clic on the music which is played)

    Home Automation Plugin rendering :

    If I add an LMS playlist to the LMS's favorites (like this each modification done on spotify is applied when starting the playlist from the favorites, Best user experience ever , thanks for this), i have an issue with the name displayed :
    LMS rendering :

    Home Automation Plugin rendering :

    As you can see, the information are gathered from the first line displayed, well i do assume so.

    I have open the code of the Plugin.pm which collects the information and send them to the Home Automation plugin, I have tried to understand how to get the title, Artist and Album name from the above screenshots, which are good, to have them send to the home automation plugin with no success.

    Here is the code in Plugin.pm :
    sub commandCallbackNewsong {
    	my $request = shift;
    	my $client = $request->client();
    	if( !defined( $client)) {
    	if( $request->isCommand([['playlist'], ['newsong']]) ) {
    		my $sTitle = $client->playingSong();
    		my $sName =  'Aucun';
    		my $artist   = '';
    		my $album    = '';
    		my $tracknum = '';
    		my $duration =  0;
    		my $played =  0;
    		eval { $sName = uri_escape(encode('utf-8',decode($enc,$sTitle->track()->title)))  || '';}; warn $@ if $@;
    		eval { $artist   = uri_escape(encode('utf-8',decode($enc,$sTitle->track()->artistName))) || 'Plugin';}; warn $@ if $@;
    		eval { $album    = uri_escape(encode('utf-8',decode($enc,$sTitle->track()->albumname))) || 'Plugin';}; warn $@ if $@;
                   #I have removed the part which sends the information from $sName,$artist,$album) this point is ok, because i receive from $sName the value : spotify://track:fds56f4sd65f4dsf56sd

    I have two thoughts on how to fix this (but maybe it is impossible, or maybe i am wrong in my understanding of how it works in spotty plugin)

    - Having spotty plugin displaying the good information, the concatenate of Song Name BY Artist Name From Album Name when accessing to an LMS favorite

    - Having access to the information (Artist Name / Album Name / Song Name) in the Plugin.pm which is used to send information to the home automation Server ?

    I am pretty sure this is easy for one who knows how LMS works, but after hours of reading in the forum, in the wiki, and testing some codes I did not find the solution.

    Many thanks for your help,

    Sorry for this long post, but I try to be the more complete in order to give you all the researches I have done.


  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    I would suggest you use the "status" query (as documented in the CLI documentation rather than to try to grab the information from the track object yourself. That's what all the other UIs do, and it does the difficult part for you.

    # request the current player's status. Starting with the current track ('-'), grab information for one single track:
    my $r = $client->execute(['status', '-', 1, 'tags:aKl']);
    # playlist_loop of the response is a list of track information hashes. We only have requested on - grab it:
    my $track = $r->getResult('playlist_loop')->[0];
    # extract the nice pieces of information from the $track hash ref:
    my $artist = $track->{artist};
    my $album = $track->{album};
    my $title = $track->{title};

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

  3. #3
    Junior Member
    Join Date
    Feb 2018
    Hello Michael,

    I do really thank you very much for your help !!!!

    It is working well now !!!!!!

    LMS Side :

    I will ask for the modification in the plugin concerned by this point.

    Really amazing !!!

    Thanks again !!!!

    I will continue to enjoy using your plugin for a long long long time

    Do you want me to rename the title of the post ?

    Really thank you :

  4. #4
    Senior Member Mnyb's Avatar
    Join Date
    Feb 2006
    Vństerňs Sweden
    Excellent work sir .

    Should not the author of the home automation plugin be notified ? He will probably accept your changes in to the plugin.
    Main hifi: Touch + CIA PS +MeridianG68J MeridianHD621 MeridianG98DH 2 x MeridianDSP5200 MeridianDSP5200HC 2 xMeridianDSP3100 +Rel Stadium 3 sub.
    Bedroom/Office: Boom
    Kitchen: Touch + powered Fostex PM0.4
    Misc use: Radio (with battery)
    iPad1 with iPengHD & SqueezePad
    (spares Touch, SB3, reciever ,controller )
    server HP proliant micro server N36L with ClearOS Linux


  5. #5
    Junior Member
    Join Date
    Feb 2018

    Thank You It helps Me

    This really helps me in solving my problems with the device.

Posting Permissions

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