[Slim-Checkins] r10076 - in /branches/6.5/server: Changelog6.html Slim/Buttons/Common.pm Slim/Player/Client.pm

kdf at svn.slimdevices.com kdf at svn.slimdevices.com
Wed Sep 27 22:33:54 PDT 2006


Author: kdf
Date: Wed Sep 27 22:33:52 2006
New Revision: 10076

URL: http://svn.slimdevices.com?rev=10076&view=rev
Log:
Bug: 4205
Description: merge -r10073:10075 from trunk


Modified:
    branches/6.5/server/Changelog6.html
    branches/6.5/server/Slim/Buttons/Common.pm
    branches/6.5/server/Slim/Player/Client.pm

Modified: branches/6.5/server/Changelog6.html
URL: http://svn.slimdevices.com/branches/6.5/server/Changelog6.html?rev=10076&r1=10075&r2=10076&view=diff
==============================================================================
--- branches/6.5/server/Changelog6.html (original)
+++ branches/6.5/server/Changelog6.html Wed Sep 27 22:33:52 2006
@@ -23,6 +23,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4191">#4191</a> - Live365 Search has missing strings</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4192">#4192</a> - IE doesn't refresh status</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4213">#4213</a> - Slimserver can crash due to display being deleted from client object at forget time</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4205">#4205</a> - sleep function with SlimServer 6.5.0 in Fishbone skin, songs longer than 90 minutes</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4221">#4221</a> - 6.5 crashes on artist breadcrumb</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4228">#4228</a> - Fishbone skin status doesn't update from an empty playlist</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4237">#4237</a> - in Help > Internet Radio there is a dead link to Settings</li>

Modified: branches/6.5/server/Slim/Buttons/Common.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Slim/Buttons/Common.pm?rev=10076&r1=10075&r2=10076&view=diff
==============================================================================
--- branches/6.5/server/Slim/Buttons/Common.pm (original)
+++ branches/6.5/server/Slim/Buttons/Common.pm Wed Sep 27 22:33:52 2006
@@ -880,6 +880,17 @@
 		# find the next value for the sleep timer
 		for ($i = 0; $i <= $#sleepChoices; $i++) {
 
+			# case of remaining time matching a defined time within same range as used in prettySleepTime.
+			if ( int($remaining + 0.5) == int($sleepChoices[$i] + 0.5)) {
+				
+				#don't skip if this is the last entry, but reset the redundant entries to end of song.
+				$sleepChoices[$i] = $remaining;
+				if ($i != $#sleepChoices) {
+					$i++;
+					$sleepChoices[$i] = $remaining;
+				}
+			}
+			
 			if ( $sleepChoices[$i] > $client->currentSleepTime() ) {
 				last;
 			}
@@ -889,6 +900,7 @@
 			$i = 0;
 		}
 
+		# if remaining time matches the sleeptime to within a minute, set as remaining time
 		my $sleepTime = $sleepChoices[$i];
 
 		$client->execute(["sleep", $sleepTime * 60]);

Modified: branches/6.5/server/Slim/Player/Client.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Slim/Player/Client.pm?rev=10076&r1=10075&r2=10076&view=diff
==============================================================================
--- branches/6.5/server/Slim/Player/Client.pm (original)
+++ branches/6.5/server/Slim/Player/Client.pm Wed Sep 27 22:33:52 2006
@@ -755,13 +755,13 @@
 	my $sleeptime = $client->sleepTime() - Time::HiRes::time();
 	my $sleepstring = "";
 	
-	my $dur = Slim::Player::Source::playingSongDuration($client);
-	my $remaining = $dur - Slim::Player::Source::songTime($client);
-	
+	my $dur = Slim::Player::Source::playingSongDuration($client) || 0;
+	my $remaining = $dur - Slim::Player::Source::songTime($client) || 0;
+
 	if ($client->sleepTime) {
 		
-		# check against remaining time to see if sleep time matches within 1 second.
-		if (int($sleeptime + 0.5) == int($remaining)) {
+		# check against remaining time to see if sleep time matches within a minute.
+		if (int($sleeptime/60 + 0.5) == int($remaining/60 + 0.5)) {
 			$sleepstring = join(' ',$client->string('SLEEPING_AT'),$client->string('END_OF_SONG'));
 		} else {
 			$sleepstring = join(" " ,$client->string('SLEEPING_IN'),int($sleeptime/60)+1,$client->string('MINUTES'));



More information about the checkins mailing list