[Slim-Checkins] r10055 - in /trunk/server/Slim: Buttons/Common.pm
Player/Client.pm
kdf at svn.slimdevices.com
kdf at svn.slimdevices.com
Tue Sep 26 19:40:48 PDT 2006
Author: kdf
Date: Tue Sep 26 19:40:46 2006
New Revision: 10055
URL: http://svn.slimdevices.com?rev=10055&view=rev
Log:
Bug: 4205
Descriptioin: sort numerically, and track songtime/sleeptime for 'end of song' display
Modified:
trunk/server/Slim/Buttons/Common.pm
trunk/server/Slim/Player/Client.pm
Modified: trunk/server/Slim/Buttons/Common.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Buttons/Common.pm?rev=10055&r1=10054&r2=10055&view=diff
==============================================================================
--- trunk/server/Slim/Buttons/Common.pm (original)
+++ trunk/server/Slim/Buttons/Common.pm Tue Sep 26 19:40:46 2006
@@ -932,7 +932,7 @@
}
# add the 'after this song' option only if there is a defined value.
- my @sleepChoices = $remaining ? sort(0, $remaining, 15,30,45,60,90) : (0,15,30,45,60,90);
+ my @sleepChoices = $remaining ? sort({$a <=> $b} (0, $remaining, 15,30,45,60,90)) : (0,15,30,45,60,90);
my $i = 0;
# find the next value for the sleep timer
Modified: trunk/server/Slim/Player/Client.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Client.pm?rev=10055&r1=10054&r2=10055&view=diff
==============================================================================
--- trunk/server/Slim/Player/Client.pm (original)
+++ trunk/server/Slim/Player/Client.pm Tue Sep 26 19:40:46 2006
@@ -755,10 +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);
+
if ($client->sleepTime) {
- # assumes that remaining time was under 15 minutes. might need to check against every default value just to cover all cases.
- if ($client->currentSleepTime < 15) {
+ # check against remaining time to see if sleep time matches within 1 second.
+ if (int($sleeptime + 0.5) == int($remaining)) {
$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