[Slim-Checkins] r12348 - in /trunk/server: ./ HTML/EN/settings/server/ Slim/Networking/ Slim/Networking/SqueezeNetwork/ Slim/Player/ Slim/Utils/ Slim/Utils/Prefs/ Slim/Web/Settings/Server/
andy at svn.slimdevices.com
andy at svn.slimdevices.com
Thu Jul 5 14:58:36 PDT 2007
Author: andy
Date: Thu Jul 5 14:58:36 2007
New Revision: 12348
URL: http://svn.slimdevices.com?rev=12348&view=rev
Log:
SlimServer <-> SqueezeNetwork pref syncing
When a new player connects, it will request a "sync down" of prefs from SN.
All pref changes are timestamped on both sides, so any prefs changed on SN after
the pref was changed on SS will be synced to SS.
Any time a pref is changed that SN cares about, a 30-sec timer will be set to "sync up"
that pref to SN. This will allow rapid pref changes (i.e. volume) to get bundled up into
one operation.
None of this is enabled if SN login info is not present under Server Settings -> SqueezeNetwork
and the pref to enable syncing is set.
Added:
trunk/server/Slim/Networking/SqueezeNetwork/
trunk/server/Slim/Networking/SqueezeNetwork/PrefSync.pm
Modified:
trunk/server/HTML/EN/settings/server/squeezenetwork.html
trunk/server/Slim/Networking/SqueezeNetwork.pm
trunk/server/Slim/Player/Squeezebox2.pm
trunk/server/Slim/Utils/Prefs.pm
trunk/server/Slim/Utils/Prefs/Base.pm
trunk/server/Slim/Web/Settings/Server/SqueezeNetwork.pm
trunk/server/slimserver.pl
trunk/server/strings.txt
Modified: trunk/server/HTML/EN/settings/server/squeezenetwork.html
URL: http://svn.slimdevices.com/trunk/server/HTML/EN/settings/server/squeezenetwork.html?rev=12348&r1=12347&r2=12348&view=diff
==============================================================================
--- trunk/server/HTML/EN/settings/server/squeezenetwork.html (original)
+++ trunk/server/HTML/EN/settings/server/squeezenetwork.html Thu Jul 5 14:58:36 2007
@@ -13,6 +13,18 @@
<div class="prefDesc">[% "SETUP_SN_PASSWORD_DESC" | string %]</div>
<input type="password" class="stdedit" name="sn_password" id="sn_password" value="[% prefs.sn_password %]" size="40">
+
+ <div class="prefHead">[% "SETUP_SN_SYNC" | string | upper %]</div>
+ <div class="prefDesc">[% "SETUP_SN_SYNC_DESC" | string %]</div>
+
+ <select class="stdedit" name="sn_sync" id="sn_sync">
+ <option [% IF prefs.sn_sync == 1 %]selected="selected" [% END %]value="1">
+ [% 'SETUP_SN_SYNC_ENABLE' | string %]
+ </option>
+ <option [% IF !prefs.sn_sync %]selected="selected" [% END %]value="0">
+ [% 'SETUP_SN_SYNC_DISABLE' | string %]
+ </option>
+ </select>
</div>
Modified: trunk/server/Slim/Networking/SqueezeNetwork.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Networking/SqueezeNetwork.pm?rev=12348&r1=12347&r2=12348&view=diff
==============================================================================
--- trunk/server/Slim/Networking/SqueezeNetwork.pm (original)
+++ trunk/server/Slim/Networking/SqueezeNetwork.pm Thu Jul 5 14:58:36 2007
@@ -5,16 +5,14 @@
# Async interface to SqueezeNetwork API
use strict;
-use warnings;
use base qw(Slim::Networking::SimpleAsyncHTTP);
-use Digest::SHA1 qw(sha1_base64);
-#use JSON::XS qw(from_json);
-use JSON::Syck;
use MIME::Base64 qw(decode_base64);
use URI::Escape qw(uri_escape);
+use Slim::Networking::SqueezeNetwork::PrefSync;
use Slim::Utils::IPDetect;
+use JSON::Syck;
use Slim::Utils::Log;
use Slim::Utils::Misc;
use Slim::Utils::Prefs;
@@ -27,6 +25,80 @@
my $prefs = preferences('server');
+# Initialize by fetching the SN server time and storing our time difference
+sub init {
+ my $class = shift;
+
+ $log->info('SqueezeNetwork Sync Init');
+
+ my $timeURL = $class->url( '/api/v1/time' );
+
+ my $http = $class->new(
+ \&_init_done,
+ \&_init_error,
+ );
+
+ $http->get( $timeURL );
+}
+
+sub _init_done {
+ my $http = shift;
+
+ my $snTime = $http->content;
+
+ if ( $snTime !~ /^\d+$/ ) {
+ $http->error( "Invalid SqueezeNetwork server timestamp" );
+ return _init_error( $http );
+ }
+
+ my $diff = $snTime - time();
+
+ $log->info("Got SqueezeNetwork server time: $snTime, diff: $diff");
+
+ $prefs->set( 'sn_timediff' => $diff );
+
+ # Clear error counter
+ $prefs->remove( 'snInitErrors' );
+
+ # Init pref syncing
+ Slim::Networking::SqueezeNetwork::PrefSync->init();
+}
+
+sub _init_error {
+ my $http = shift;
+ my $error = $http->error;
+
+ $log->error( "Unable to get SqueezeNetwork server time, sync is disabled: $error" );
+
+ $prefs->remove('sn_timediff');
+
+ # back off if we keep getting errors
+ my $count = $prefs->get('snInitErrors') || 0;
+ $prefs->set( snInitErrors => $count + 1 );
+
+ my $retry = 300 * ( $count + 1 );
+
+ $log->error( "SqueezeNetwork sync init failed: $error, will retry in $retry" );
+
+ Slim::Utils::Timers::setTimer(
+ undef,
+ time() + $retry,
+ sub {
+ __PACKAGE__->init();
+ }
+ );
+}
+
+# Stop all communication with SN, if the user removed their login info for example
+sub shutdown {
+ my $class = shift;
+
+ $prefs->remove('sn_timediff');
+
+ # Shutdown pref syncing
+ Slim::Networking::SqueezeNetwork::PrefSync->shutdown();
+}
+
# Return a correct URL for SqueezeNetwork
sub url {
my ( $class, $path ) = @_;
@@ -82,7 +154,7 @@
$password = $prefs->get('sn_password');
if ( $password ) {
- $password = sha1_base64( decode_base64( $password ) );
+ $password = decode_base64( $password );
}
}
@@ -113,16 +185,16 @@
$self->get( $url );
}
-# Override GET to add session cookie header
-sub get {
- my ( $self, $url, %headers ) = @_;
+# Override to add session cookie header
+sub _createHTTPRequest {
+ my ( $self, $type, $url, @args ) = @_;
# Add session cookie if we have it
if ( my $client = $self->params('client') ) {
if ( my $sid = $client->snSession ) {
- $headers{Cookie} = 'sdi_squeezenetwork_session=' . uri_escape($sid);
- $headers{'X-Player-MAC'} = $client->id;
+ unshift @args, 'Cookie', 'sdi_squeezenetwork_session=' . uri_escape($sid);
+ unshift @args, 'X-Player-MAC', $client->id;
}
else {
$log->info("Logging in to SqueezeNetwork to obtain session ID");
@@ -132,13 +204,13 @@
client => $client,
callback => sub {
if ( my $sid = $client->snSession ) {
- $headers{Cookie} = 'sdi_squeezenetwork_session=' . uri_escape($sid);
- $headers{'X-Player-MAC'} = $client->id;
+ unshift @args, 'Cookie', 'sdi_squeezenetwork_session=' . uri_escape($sid);
+ unshift @args, 'X-Player-MAC', $client->id;
$log->info("Got SqueezeNetwork session ID: $sid");
}
- $self->SUPER::get( $url, %headers );
+ $self->SUPER::_createHTTPRequest( $type, $url, @args );
},
);
@@ -146,14 +218,13 @@
}
}
- $self->SUPER::get( $url, %headers );
-}
+ $self->SUPER::_createHTTPRequest( $type, $url, @args );
+}
sub _login_done {
my $self = shift;
my $params = $self->params('params');
- #my $json = eval { from_json( $self->content ) };
my $json = eval { JSON::Syck::Load( $self->content ) };
if ( $@ ) {
@@ -177,7 +248,7 @@
# XXX: Error handling
- $params->{callback}->();
+ $log->error( "Unable to login to SN: $error" );
}
sub _construct_url {
Added: trunk/server/Slim/Networking/SqueezeNetwork/PrefSync.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Networking/SqueezeNetwork/PrefSync.pm?rev=12348&view=auto
==============================================================================
--- trunk/server/Slim/Networking/SqueezeNetwork/PrefSync.pm (added)
+++ trunk/server/Slim/Networking/SqueezeNetwork/PrefSync.pm Thu Jul 5 14:58:36 2007
@@ -1,0 +1,368 @@
+package Slim::Networking::SqueezeNetwork::PrefSync;
+
+# $Id: SqueezeNetwork.pm 11768 2007-04-16 18:14:55Z andy $
+
+# Sync prefs from SS <-> SN
+
+use strict;
+
+use File::Basename qw(basename dirname);
+use File::Spec::Functions qw(catfile);
+use JSON::Syck;
+
+use Slim::Control::Request;
+use Slim::Hardware::IR;
+use Slim::Networking::SqueezeNetwork;
+use Slim::Utils::Log;
+use Slim::Utils::Misc;
+use Slim::Utils::Prefs;
+use Slim::Utils::Timers;
+
+my $log = Slim::Utils::Log->addLogCategory({
+ 'category' => 'network.squeezenetwork',
+ 'defaultLevel' => 'DEBUG',
+ 'description' => 'SQUEEZENETWORK_LOGGING',
+});
+
+my $prefs = preferences('server');
+
+# List of prefs we want to sync to SN
+our $can_sync = {};
+
+sub init {
+ my $class = shift;
+
+ # Get the list of prefs SN will sync with us
+ my $http = Slim::Networking::SqueezeNetwork->new(
+ \&_init_done,
+ \&_init_error,
+ );
+
+ $http->get( $http->url( '/api/v1/prefs/can_sync' ) );
+}
+
+sub _init_done {
+ my $http = shift;
+
+ my $res = eval { JSON::Syck::Load( $http->content ) };
+ if ( $@ || ref $res ne 'ARRAY' ) {
+ $http->error( $@ || 'Invalid JSON response' );
+ return _init_error( $http );
+ }
+
+ $can_sync = {
+ map { $_ => 1 }
+ @{ $res }
+ };
+
+ if ( $log->is_debug ) {
+ $log->debug("Got list of SN prefs to sync: " . scalar(@{$res}) . " prefs");
+ }
+
+ # Sync all connected clients with SN
+ # New clients will be handled by clientEvent
+ for my $client ( Slim::Player::Client::clients() ) {
+ next unless $client->isa('Slim::Player::Squeezebox2');
+
+ Slim::Utils::Timers::setTimer(
+ $client,
+ time() + 10,
+ \&syncDown,
+ );
+ }
+
+ # Subscribe to pref changes
+ Slim::Control::Request::subscribe(
+ \&prefEvent,
+ [['prefset']]
+ );
+
+ # Subscribe to player connect/disconnect messages
+ Slim::Control::Request::subscribe(
+ \&clientEvent,
+ [['client'],['new','reconnect','disconnect']]
+ );
+}
+
+sub clientEvent {
+ my $request = shift;
+ my $client = $request->client;
+
+ if ( !$client->isa('Slim::Player::Squeezebox2') ) {
+ return;
+ }
+
+ Slim::Utils::Timers::killTimers( $client, \&syncDown );
+
+ # If the event was for a new client, sync down now
+ my $event = $request->getRequest(1);
+ if ( $event =~ /(?:new|reconnect)/ ) {
+ $log->debug( $client->id . ": Got client $event event, syncing prefs from SN" );
+ syncDown($client);
+ }
+ elsif ( $event eq 'disconnect' ) {
+ # Client is gone, kill any pending syncUp event (syncDown killed above)
+ $log->debug( $client->id . ': Got client disconnect event, disabling sync' );
+ Slim::Utils::Timers::killTimers( $client, \&syncUp );
+ }
+}
+
+sub _init_error {
+ my $http = shift;
+ my $error = $http->error;
+
+ $log->error( "Unable to get list of prefs to sync with SqueezeNetwork, sync is disabled: $error" );
+
+ $can_sync = {};
+}
+
+# Shut down
+sub shutdown {
+ my $class = shift;
+
+ $can_sync = {};
+
+ Slim::Control::Request::unsubscribe( \&prefEvent );
+
+ Slim::Control::Request::unsubscribe( \&clientEvent );
+
+ for my $client ( Slim::Player::Client::clients() ) {
+ Slim::Utils::Timers::killTimers( $client, \&syncUp );
+ Slim::Utils::Timers::killTimers( $client, \&syncDown );
+ }
+
+ $log->info( "SqueezeNetwork pref sync shutdown" );
+}
+
+sub syncDown {
+ my $client = shift || return;
+
+ my $http = Slim::Networking::SqueezeNetwork->new(
+ \&_syncDown_done,
+ \&_syncDown_error,
+ {
+ client => $client,
+ },
+ );
+
+ my $sync = {
+ client => $client->id,
+ since => $prefs->client($client)->get('snLastSyncDown'),
+ };
+
+ if ( $log->is_debug ) {
+ $log->debug( "Syncing down from SN: " . Data::Dump::dump($sync) );
+ }
+
+ my $json = eval { JSON::Syck::Dump($sync) };
+ if ( $@ ) {
+ $http->error( $@ );
+ return _syncDown_error( $http );
+ }
+
+ $http->post( $http->url( '/api/v1/prefs/sync_down' ), $json );
+}
+
+sub _syncDown_done {
+ my $http = shift;
+ my $client = $http->params('client');
+
+ my $content = eval { JSON::Syck::Load( $http->content ) };
+ if ( $@ || $content->{error} ) {
+ $http->error( $@ || $content->{error} );
+ return _syncDown_error( $http );
+ }
+
+ my $cprefs = $prefs->client($client);
+
+ if ( $log->is_debug ) {
+ $log->debug( 'Sync down data from SN: ' . Data::Dump::dump($content) );
+ }
+
+ $cprefs->set( snLastSyncDown => $content->{timestamp} );
+ $cprefs->set( snSyncInterval => $content->{next_sync} );
+
+ $cprefs->remove('snSyncErrors');
+
+ while ( my ($pref, $data) = each %{ $content->{prefs} } ) {
+
+ # compare timestamps
+ if ( $data->{ts} > $cprefs->timestamp($pref) ) {
+
+ # special handling needed to rewrite disabledirsets with full pathname
+ if ( $pref eq 'disabledirsets' ) {
+ # Force array pref
+ if ( !ref $data->{value} ) {
+ $data->{value} = [ $data->{value} ];
+ }
+
+ # XXX: This may break if users have custom IR files in a different directory
+ my $irfiles = Slim::Hardware::IR::irfiles();
+ my $dir = dirname( (keys %{$irfiles})[0] );
+ $data->{value} = [ map { catfile( $dir, $_ ) } @{ $data->{value} } ];
+ }
+
+ if ( $log->is_debug ) {
+ $log->debug("Synced $pref to: " . Data::Dump::dump( $data->{value} ) );
+ }
+
+ $cprefs->set( $pref => $data->{value} );
+
+ # Wipe timestamp values so the pref is
+ # not immediately synced back up to SN
+ $cprefs->timestamp( $pref, 'wipe' );
+ }
+ }
+
+ $client->update;
+
+ $log->debug( 'Synced prefs from SN for player ' . $client->id );
+
+ # Schedule next sync
+ Slim::Utils::Timers::setTimer(
+ $client,
+ time() + $content->{next_sync},
+ \&syncDown
+ );
+}
+
+sub _syncDown_error {
+ my $http = shift;
+ my $error = $http->error;
+
+ my $client = $http->params('client');
+
+ # back off if we keep getting errors
+ my $cprefs = $prefs->client($client);
+ my $count = $cprefs->get('snSyncErrors') || 0;
+ $cprefs->set( snSyncErrors => $count + 1 );
+
+ my $retry = $cprefs->get('snSyncInterval') * ( $count + 1 );
+
+ $log->error( "Sync Down failed: $error, will retry in $retry" );
+
+ Slim::Utils::Timers::setTimer(
+ $client,
+ time() + $retry,
+ \&syncDown,
+ );
+}
+
+# Callback whenever a pref is changed
+sub prefEvent {
+ my $request = shift;
+ my $client = $request->client || return;
+
+ if ( !$client->isa('Slim::Player::Squeezebox2') ) {
+ return;
+ }
+
+ my $ns = $request->getParam('_namespace');
+ my $pref = $request->getParam('_prefname');
+ my $value = $request->getParam('_newvalue');
+
+ # Is the pref one we care about?
+ if ( !exists $can_sync->{$pref} ) {
+ return;
+ }
+
+ # Was this pref just synced to us from SN? If so, ignore it
+ if ( $prefs->client($client)->timestamp($pref) == -1 ) {
+ return;
+ }
+
+ if ( $log->is_debug ) {
+ $log->debug( "prefEvent to sync: " . $client->id . " / $ns / $pref / " . Data::Dump::dump($value) );
+ }
+
+ # Kill existing sync timer, if any
+ # This way, if someone is changing a lot of prefs, we don't sync until things
+ # have settled down for a while
+ Slim::Utils::Timers::killTimers( $client, \&syncUp );
+
+ # Set a timer to sync the changes
+ Slim::Utils::Timers::setTimer( $client, Time::HiRes::time() + 30, \&syncUp );
+}
+
+sub syncUp {
+ my $client = shift || return;
+
+ my $cprefs = $prefs->client($client);
+
+ my $sync = {
+ client => $client->id,
+ prefs => {},
+ };
+
+ my $sn_timediff = $prefs->get('sn_timediff');
+
+ # Send prefs that have been changed since the last sync
+ my $lastSync = $cprefs->get('snLastSyncUp');
+
+ for my $pref ( keys %{$can_sync} ) {
+ my $ts = $cprefs->timestamp($pref);
+ if ( $ts >= $lastSync ) {
+ my $value = $cprefs->get($pref);
+ if ( !defined $value ) {
+ $value = $prefs->get($pref);
+ }
+
+ # special handling needed to rewrite disabledirsets with no pathname
+ if ( $pref eq 'disabledirsets' ) {
+ $value = [ map { basename($_) } @{$value} ];
+ }
+
+ $sync->{prefs}->{$pref} = {
+ value => $value,
+ ts => $ts + $sn_timediff,
+ };
+ }
+ }
+
+ if ( $log->is_debug ) {
+ $log->debug( 'Syncing up to SN: ' . Data::Dump::dump($sync) );
+ }
+
+ my $json = eval { JSON::Syck::Dump($sync) };
+ if ( $@ ) {
+ $log->error( "Unable to sync up: $@" );
+ return;
+ }
+
+ $cprefs->set( snLastSyncUp => time() );
+
+ my $http = Slim::Networking::SqueezeNetwork->new(
+ \&_syncUp_done,
+ \&_syncUp_error,
+ {
+ client => $client,
+ },
+ );
+
+ $http->post( $http->url( '/api/v1/prefs/sync_up' ), $json );
+}
+
+sub _syncUp_done {
+ my $http = shift;
+
+ my $content = eval { JSON::Syck::Load( $http->content ) };
+
+ if ( $@ || $content->{error} ) {
+ $http->error( $@ || $content->{error} );
+ return _syncUp_error( $http );
+ }
+
+ $log->info( 'Sync OK' );
+}
+
+sub _syncUp_error {
+ my $http = shift;
+ my $error = $http->error;
+ my $client = $http->params('client');
+
+ $prefs->client($client)->set( snLastSyncUp => -1 );
+
+ $log->error( "Sync Up failed: $error" );
+}
+
+1;
Modified: trunk/server/Slim/Player/Squeezebox2.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Squeezebox2.pm?rev=12348&r1=12347&r2=12348&view=diff
==============================================================================
--- trunk/server/Slim/Player/Squeezebox2.pm (original)
+++ trunk/server/Slim/Player/Squeezebox2.pm Thu Jul 5 14:58:36 2007
@@ -39,6 +39,9 @@
'transitionDuration' => 0,
'replayGainMode' => 0,
'disableDac' => 0,
+ 'snLastSyncUp' => -1,
+ 'snLastSyncDown' => -1,
+ 'snSyncInterval' => 30,
};
# Keep track of direct stream redirects
Modified: trunk/server/Slim/Utils/Prefs.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Prefs.pm?rev=12348&r1=12347&r2=12348&view=diff
==============================================================================
--- trunk/server/Slim/Utils/Prefs.pm (original)
+++ trunk/server/Slim/Utils/Prefs.pm Thu Jul 5 14:58:36 2007
@@ -204,6 +204,8 @@
'coverArt' => '',
'artfolder' => '',
'thumbSize' => 100,
+ # Server Settings - SqueezeNetwork
+ 'sn_sync' => 1,
);
# add entry to dispatch table if it is loaded (it isn't in scanner.pl) as migration may call notify for this
Modified: trunk/server/Slim/Utils/Prefs/Base.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Prefs/Base.pm?rev=12348&r1=12347&r2=12348&view=diff
==============================================================================
--- trunk/server/Slim/Utils/Prefs/Base.pm (original)
+++ trunk/server/Slim/Utils/Prefs/Base.pm Thu Jul 5 14:58:36 2007
@@ -113,6 +113,8 @@
$log->debug(sprintf "setting %s:%s:%s to %s", $namespace, $clientid, $pref, defined $new ? $new : 'undef');
$class->{'prefs'}->{ $pref } = $new;
+
+ $class->{'prefs'}->{ '_ts_' . $pref } = time();
$root->save;
@@ -225,6 +227,22 @@
my $class = shift;
return $class->_root->{'namespace'};
+}
+
+=head2 timestamp( $pref )
+
+Returns last-modified timestamp for this preference
+
+=cut
+
+sub timestamp {
+ my ( $class, $pref, $wipe ) = @_;
+
+ if ( $wipe ) {
+ $class->{'prefs'}->{ '_ts_' . $pref } = -1;
+ }
+
+ return $class->{'prefs'}->{ '_ts_' . $pref } ||= 0;
}
sub AUTOLOAD {
Modified: trunk/server/Slim/Web/Settings/Server/SqueezeNetwork.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Web/Settings/Server/SqueezeNetwork.pm?rev=12348&r1=12347&r2=12348&view=diff
==============================================================================
--- trunk/server/Slim/Web/Settings/Server/SqueezeNetwork.pm (original)
+++ trunk/server/Slim/Web/Settings/Server/SqueezeNetwork.pm Thu Jul 5 14:58:36 2007
@@ -10,6 +10,7 @@
use strict;
use base qw(Slim::Web::Settings);
+use Slim::Networking::SqueezeNetwork;
use Slim::Utils::Strings qw(string);
use Slim::Utils::Misc;
use Slim::Utils::Prefs;
@@ -25,7 +26,7 @@
}
sub prefs {
- my @prefs = qw(sn_email sn_password);
+ my @prefs = qw(sn_email sn_password sn_sync);
return ($prefs, @prefs);
}
@@ -36,8 +37,24 @@
if ( $params->{saveSettings} ) {
if ( $params->{sn_password} ) {
-
$params->{sn_password} = MIME::Base64::encode_base64( $params->{sn_password}, '' );
+ }
+
+ # XXX: Verify username/password
+
+ }
+
+ if ( $params->{sn_email}
+ && $params->{sn_password}
+ && defined $params->{sn_sync}
+ && $params->{sn_sync} ne $prefs->get('sn_sync')
+ ) {
+ # Shut down all SN activity
+ Slim::Networking::SqueezeNetwork->shutdown();
+
+ # Start it up again if the user enabled it
+ if ( $params->{sn_sync} ) {
+ Slim::Networking::SqueezeNetwork->init();
}
}
Modified: trunk/server/slimserver.pl
URL: http://svn.slimdevices.com/trunk/server/slimserver.pl?rev=12348&r1=12347&r2=12348&view=diff
==============================================================================
--- trunk/server/slimserver.pl (original)
+++ trunk/server/slimserver.pl Thu Jul 5 14:58:36 2007
@@ -144,6 +144,7 @@
use Slim::Utils::Scanner;
use Slim::Utils::Scheduler;
use Slim::Networking::Select;
+use Slim::Networking::SqueezeNetwork;
use Slim::Networking::UDP;
use Slim::Web::Setup;
use Slim::Control::Stdio;
@@ -336,6 +337,11 @@
$log->info("Cache init...");
Slim::Utils::Cache->init();
+
+ if ( $prefs->get('sn_email') && $prefs->get('sn_sync') ) {
+ $log->info("SqueezeNetwork Sync Init...");
+ Slim::Networking::SqueezeNetwork->init();
+ }
unless ( $noupnp || $prefs->get('noupnp') ) {
$log->info("UPnP init...");
Modified: trunk/server/strings.txt
URL: http://svn.slimdevices.com/trunk/server/strings.txt?rev=12348&r1=12347&r2=12348&view=diff
==============================================================================
--- trunk/server/strings.txt (original)
+++ trunk/server/strings.txt Thu Jul 5 14:58:36 2007
@@ -6924,6 +6924,18 @@
DE Geben Sie bitte das Passwort für ihren SqueezeNetwork-Zugang an.
EN Enter the password for your SqueezeNetwork account.
+SETUP_SN_SYNC
+ EN SqueezeNetwork Integration
+
+SETUP_SN_SYNC_DESC
+ EN By default, many player settings are synchronized between SlimServer and SqueezeNetwork. To disable this feature, select the Disabled option below.
+
+SETUP_SN_SYNC_ENABLE
+ EN Enabled, keep player settings in sync.
+
+SETUP_SN_SYNC_DISABLE
+ EN Disabled, do not keep player settings in sync.
+
#
# Web interface
#
More information about the checkins
mailing list