Index: Plugins/Rescan/Plugin.pm =================================================================== --- Plugins/Rescan/Plugin.pm (revision 10932) +++ Plugins/Rescan/Plugin.pm (working copy) @@ -41,8 +41,7 @@ if ($browseMenuChoices[$menuSelection{$client}] eq $client->string('PLUGIN_RESCAN_PRESS_PLAY')) { - my @pargs=('rescan'); - $client->execute(\@pargs, undef, undef); + executeRescan(); $client->showBriefly( { 'line' => [ $client->string('PLUGIN_RESCAN_MUSIC_LIBRARY'), @@ -91,8 +90,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', 'externRef' => sub { my $client = shift; my $value = shift; @@ -217,35 +220,41 @@ 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') { + } + } - $rescanType = ['wipecache']; + setTimer(); +} - } elsif ($rescanPref eq '3playlist') { +sub executeRescan { + + my $rescanType = ['rescan']; + my $rescanPref = Slim::Utils::Prefs::get('rescan-type') || ''; - $rescanType = [qw(rescan playlists)]; - } + if ($rescanPref eq '2wipedb') { - if ($time == $scantime && !Slim::Music::Import->stillScanning()) { + $rescanType = ['wipecache']; - logger('scan.scanner')->info("Initiating scan of type: ", $rescanType->[0]); + } elsif ($rescanPref eq '3playlist') { - Slim::Control::Request::executeRequest(undef, $rescanType); - } - } + $rescanType = [qw(rescan playlists)]; } - setTimer(); + if (!Slim::Music::Import->stillScanning()) { + + logger('scan.scanner')->info("Initiating scan of type: ", $rescanType->[0]); + + Slim::Control::Request::executeRequest(undef, $rescanType); + } } 1;