gharris999;512197 Wrote: > Interesting. Which server is processing the json switch-back request: > the local server, or mysb.com? I.e. to which server do you send the > json request? (Argh. Having switched from coffee to green tea has done > nothing for my syntactical skills.)
The request is sent to mysb.com directly. I run about the same code as 'mysbstatus_json.pl' (http://forums.slimdevices.com/showthread.php?p=470590#post470590) as part of my power daemon. I used to query mysb.com only to see if a player was playing, before switching it back with a CLI request to SC. Now I still send players to mySB.com using a CLI query to SC, but send them back to SC using a Json query to the server on mySB.com. Before asking for reconnection to SC, I run "@query=([$id,['connected','?']]);" against mySB.com, which returns "_connected => 1" if that specific player is present on mySB.com. (A serverstatus query does it as well, returning among other things a "connected" key -yep, without underscore-, for each player.) To my great satisfaction, I now only use "connect" directives, and no longer the bizzaro "disconnect" command. I guess I am "switching to" twice; unholy but harmless, it seems. Which url do you do JSon queries to the local server? Is it http://localhost:9000/jsonrpc.js ? I agree parsing the CLI responses is no fun, especially when it goes south. But somehow, sending a Json request needs a lot of packing, and I have quite a bit of code that manages to use the CLI. I don't feel the urge to migrate to Json, except when the CLI can't be trusted. -- epoch1970 Daily dose delivered by: 2 SB Classic (fw 130), 1 SB Boom (fw 50) SqueezeCenter 7.3.4 (Debian 5.0) with plugins: ContextMenu, SaverSwitcher by Peter Watkins Server Power Control by Gordon Harris WeatherTime by Martin Rehfeld IRBlaster by Gwendesign (Felix) FindArt, CDplayer by bpa BBC iPlayer, SwitchPlayer by Triode PowerSave by Jason Holzapple TrackStat by Erland Isaksson. ------------------------------------------------------------------------ epoch1970's Profile: http://forums.slimdevices.com/member.php?userid=16711 View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________ plugins mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/plugins
