[Slim-Checkins] r8801 - in /trunk/server: Changelog6.html Plugins/Rescan.pm Slim/Buttons/Common.pm

kdf at svn.slimdevices.com kdf at svn.slimdevices.com
Fri Aug 4 17:28:07 PDT 2006


Author: kdf
Date: Fri Aug  4 17:28:05 2006
New Revision: 8801

URL: http://svn.slimdevices.com?rev=8801&view=rev
Log:
Bug: 2151
Description: add a sleep after current song option, if a song is playing, then a new time option gets inserted that will match with the end of the currently playing song.

Bug: 3867
Description: proper pref name for rescan-type


Modified:
    trunk/server/Changelog6.html
    trunk/server/Plugins/Rescan.pm
    trunk/server/Slim/Buttons/Common.pm

Modified: trunk/server/Changelog6.html
URL: http://svn.slimdevices.com/trunk/server/Changelog6.html?rev=8801&r1=8800&r2=8801&view=diff
==============================================================================
--- trunk/server/Changelog6.html (original)
+++ trunk/server/Changelog6.html Fri Aug  4 17:28:05 2006
@@ -170,6 +170,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2018">#2018</a> - Player Remote Keys sometimes bounce</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2081">#2081</a> - SB2 fails to respond to remote when Slimserver busy</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2107">#2107</a> - Sort order of &quot;Browse Songs&quot;</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2151">#2151</a> - Sleep after current song</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2173">#2173</a> - Need a way to delete saved playlists through command line...</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2314">#2314</a> - Volume zero when player paused</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2323">#2323</a> - playlist files still causing scanning issues</li>
@@ -464,6 +465,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3859">#3859</a> - genre favorites play via player, but not via web interface</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3861">#3861</a> - Search crashes slimserver</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3866">#3866</a> - Multidisc albums in different folders not recognized as same album</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3867">#3867</a> - Rescan.pm misdisplay of scan type</li>
 	</ul>
 </ul>
 

Modified: trunk/server/Plugins/Rescan.pm
URL: http://svn.slimdevices.com/trunk/server/Plugins/Rescan.pm?rev=8801&r1=8800&r2=8801&view=diff
==============================================================================
--- trunk/server/Plugins/Rescan.pm (original)
+++ trunk/server/Plugins/Rescan.pm Fri Aug  4 17:28:05 2006
@@ -91,7 +91,7 @@
 				setTimer($client);
 			
 			} elsif ($browseMenuChoices[$menuSelection{$client}] eq $client->string('PLUGIN_RESCAN_TIMER_TYPE')) {
-				my $value = Slim::Utils::Prefs::get("rescantype");
+				my $value = Slim::Utils::Prefs::get("rescan-type");
 				
 				my %params = (
 

Modified: trunk/server/Slim/Buttons/Common.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Buttons/Common.pm?rev=8801&r1=8800&r2=8801&view=diff
==============================================================================
--- trunk/server/Slim/Buttons/Common.pm (original)
+++ trunk/server/Slim/Buttons/Common.pm Fri Aug  4 17:28:05 2006
@@ -573,7 +573,20 @@
 	},
 	'sleep' => sub  {
 		my $client = shift;
-		my @sleepChoices = (0,15,30,45,60,90);
+		
+		# Bug: 2151 some extra stuff to add the option to sleep after the current song.
+		# first make sure we're playing, and its a valid song.
+		my $remaining;
+		if (Slim::Player::Source::playingSong($client) && $client->playmode =~ /play/) { 
+			my $dur = Slim::Player::Source::playingSongDuration($client);
+			
+			# calculate the time based remaining, in seconds then into fractional minutes.
+			$remaining = $dur - Slim::Player::Source::songTime($client);
+			$remaining = $remaining / 60;
+		}
+		
+		# add the 'after this song' option only if there is a defined value.
+		my @sleepChoices = $remaining ? (0, $remaining, 15,30,45,60,90) : (0,15,30,45,60,90);
 		my $i;
 		# find the next value for the sleep timer
 		for ($i = 0; $i <= $#sleepChoices; $i++) {



More information about the checkins mailing list