Bug 9305 - Player name is not set in player
: Player name is not set in player
Status: CLOSED FIXED
Product: MySqueezebox.com
Classification: Unclassified
Component: Web UI
: Prod
: PC Other
: -- normal (vote)
: ---
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-27 08:59 UTC by Felix Mueller
Modified: 2008-12-15 12:17 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Mueller 2008-08-27 08:59:05 UTC
If I connect a player to SC and then change the player name in SC web-interface, the player name gets set in the player itself and sticks even if the player gets disconnected and then reconnects to SC.

If I do the same when the player is connected to SN the player name is _not_ set in the player itself, but only in the web-interface. If the player gets disconnected and then reconnects to SN the old player name is shown again.
Comment 1 Michael Herger 2008-08-28 03:09:24 UTC
Andy - is this all we need? I wouldn't want to add the call to $client->prefsInit(), as this might reset the player name to an outdated value when called from elsewhere.


Index: /Users/mh/Documents/workspace/SN/lib/SDI/Service/Control.pm
===================================================================
--- /Users/mh/Documents/workspace/SN/lib/SDI/Service/Control.pm	(revision 4422)
+++ /Users/mh/Documents/workspace/SN/lib/SDI/Service/Control.pm	(working copy)
@@ -365,6 +365,9 @@
 			Slim::Buttons::Common::pushMode( $client, 'setup.welcome', undef );
 		}
 		
+		# write the player name back to the player
+		$client->setPlayerSetting('playername', $client->name);
+		
 		# Update the knob as menus may have changed
 		$client->updateKnob(1);
 		
Comment 2 Andy Grundman 2008-08-28 05:24:01 UTC
I'm not sure we want to call that every time.  I swear I did something like this already, let me find where that code is.
Comment 3 Andy Grundman 2008-08-28 05:28:09 UTC
Yeah, there is this code in Slim::Utils::Prefs:

        if ( main::SLIM_SERVICE ) {
                # Update players.name database field if name is changed
                $prefs->setChange( sub {
                        my $name   = $_[1];
                        my $client = $_[2] || return;

                        $client->playerData->name( $name );
                        $client->playerData->update;

                        # Also update the value in firmware
                        # This is handled by another setChange for playername,
                        # but the prefs code only allows one setChange action per pref
                        $client->setPlayerSetting( playername => $name );
                }, 'playername' );
        }

I think this doesn't take into account the value being changed on the web though.  Will test and fix.
Comment 4 Andy Grundman 2008-08-28 05:54:59 UTC
Fixed in r4426.

Your patch was fine, I just added a check to only run that if the name changes.
Comment 5 James Richardson 2008-12-15 12:17:06 UTC
This bug has been fixed in the latest release of SqueezeNetwork!

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.