PDA

View Full Version : Slim web interface and player selection



max.spicer
2006-03-20, 09:31
This question is mainly related to the Nokia 770 web interface, but it may also relate to the main interface. How does the interface decide which player to select in the dropdown list? Mine seems to always default to my Squeezebox3, regardless of the fact that it's not on, my Squeezebox2 is playing and I've just recently been using the web interface to control the Squeezebox2 (but have closed and reopened my browser since). Why doesn't the web interface use a cookie to store which player was controlled and then go back to that if it's not overridden by an url variable?

Max

danco
2006-03-20, 10:13
Currently the best way to fix the relevant SB is to use its MAC address as part of the Web page address.

For instance, my main SB is bookmarked by

http://localhost:9000/index.html?player=00:04:20:05:aa:a2

JJZolx
2006-03-20, 10:36
Why doesn't the web interface use a cookie to store which player was controlled and then go back to that if it's not overridden by an url variable?
Damned good question.

max.spicer
2006-03-20, 14:40
Aaargh, it's worse than I thought. I've just spent 10 seconds in the source and it appears that if there isn't a player specified in the url, the server picks a RANDOM player. Why would you want to do this? It means that not only do you not get the one you used last, you don't even get a consistent player. Humph!

I'm going to start thinking about adding a cookie!

Max


This question is mainly related to the Nokia 770 web interface, but it may also relate to the main interface. How does the interface decide which player to select in the dropdown list? Mine seems to always default to my Squeezebox3, regardless of the fact that it's not on, my Squeezebox2 is playing and I've just recently been using the web interface to control the Squeezebox2 (but have closed and reopened my browser since). Why doesn't the web interface use a cookie to store which player was controlled and then go back to that if it's not overridden by an url variable?

Max

JJZolx
2006-03-20, 14:56
Aaargh, it's worse than I thought. I've just spent 10 seconds in the source and it appears that if there isn't a player specified in the url, the server picks a RANDOM player. Why would you want to do this? It means that not only do you not get the one you used last, you don't even get a consistent player. Humph!

I'm going to start thinking about adding a cookie!
I don't believe it's random, as I always get the same player selected when there are either two or three active players on my network (depending on whether or not my system at work running Softsqueeze is connected). I asked a similar question a while back and, IIRC, it appears that the player selected is generally the first one listed in the prefs file, where they're sorted by MAC address. Which might as well be random...

User-specific settings in the Slim Server web UI, with a couple of exceptions (some stuff in the Fishbone skin), are totally absent. I don't know if this is just because it's too difficult to engineer them into the current structure of Slim Server, or if the software designers really saw no benefit to providing a feature so common to software today.

max.spicer
2006-03-21, 05:37
Ah, well I did say I spent 10 seconds with the code. ;-) It calls a function called something like getRandomClient. There's nothing to say that this always returns a different client though (or even that this function really gets called!).

Max


I don't believe it's random, as I always get the same player selected when there are either two or three active players on my network (depending on whether or not my system at work running Softsqueeze is connected). I asked a similar question a while back and, IIRC, it appears that the player selected is generally the first one listed in the prefs file, where they're sorted by MAC address. Which might as well be random...

geoffb
2006-03-21, 11:40
On 3/20/06, JJZolx wrote:
> User-specific settings in the Slim Server web UI, with a couple of
> exceptions (some stuff in the Fishbone skin), are totally absent.

Yep, I think this was mentioned a while back - the Fishbone skin sets
a cookie. This doesn't seem to work consistently though, especially
if the MusicMagic mix is called up.

Cheers
Geoff

kdf
2006-03-21, 11:57
the function is Player::Client::clientRandom, and it just returns the
first item of the array of client keys. The only randomness in this
case, is the hash "order". Since there is no inherent order to a
hash, it is hard to say which client will get picked, given no
previous knowledge. however, it should be rather consistent given a
specific setup. Adding a new player might change things, but a static
system should be fine.

It was added change 5617 by Fred, so I won't guess at the motive behind it.

As for cookies, the Fishbone skin does use them for player, and browse
mode, but it is a bit painful to manage, specifically when a change is
required.

-k