Index: Rescan.pm =================================================================== --- Rescan.pm (revision 10933) +++ Rescan.pm (working copy) @@ -36,11 +36,12 @@ 'play' => sub { my $client = shift; - if ($browseMenuChoices[$menuSelection{$client}] eq $client->string('PLUGIN_RESCAN_PRESS_PLAY')) { + my $valueref = $client->modeParam('valueRef'); - my @pargs=('rescan'); - $client->execute(\@pargs, undef, undef); + if ($$valueref eq 'PLUGIN_RESCAN_PRESS_PLAY') { + executeRescan(); + $client->showBriefly( { 'line' => [ $client->string('PLUGIN_RESCAN_MUSIC_LIBRARY'), $client->string('PLUGIN_RESCAN_RESCANNING') ] @@ -97,8 +98,12 @@ 'headerAddCount' => 1, 'stringHeader' => 1, 'callback' => \&rescanExitHandler, - 'overlayRef' => sub { return (undef, Slim::Display::Display::symbol('rightarrow')) }, - 'overlayRefArgs' => '', + 'overlayRef' => sub { + if ($_[0] ne 'PLUGIN_RESCAN_PRESS_PLAY') { + return (undef, Slim::Display::Display::symbol('rightarrow')) + } + }, + 'overlayRefArgs' => 'V' ); Slim::Buttons::Common::pushMode($client, 'INPUT.List', \%params); @@ -215,35 +220,37 @@ my $scantime = Slim::Utils::Prefs::get("rescan-time"); - if ($scantime) { + if ($scantime && $time == $scantime) { # alarm is done, so reset to find the beginning of a minute if ($time == $scantime + 60) { $interval = 1; } - my $rescanType = ['rescan']; - my $rescanPref = Slim::Utils::Prefs::get('rescan-type') || ''; + executeRescan(); - if ($rescanPref eq '2wipedb') { + } + } + setTimer(); +} - $rescanType = ['wipecache']; +sub executeRescan { + + my $rescanType = ['rescan']; + my $rescanPref = Slim::Utils::Prefs::get('rescan-type') || ''; - } elsif ($rescanPref eq '3playlist') { + if ($rescanPref eq '2wipedb') { + $rescanType = ['wipecache']; + } elsif ($rescanPref eq '3playlist') { + $rescanType = [qw(rescan playlists)]; + } - $rescanType = [qw(rescan playlists)]; - } + if (!Slim::Music::Import->stillScanning()) { - if ($time == $scantime && !Slim::Music::Import->stillScanning()) { + $::d_scan && msgf("checkScanTimer - initiating scan of type: [%s]\n", $rescanType->[0]); - $::d_scan && msgf("checkScanTimer - initiating scan of type: [%s]\n", $rescanType->[0]); - - Slim::Control::Request::executeRequest(undef, $rescanType); - } - } + Slim::Control::Request::executeRequest(undef, $rescanType); } - - setTimer(); } sub setupGroup {