[Slim-Checkins] r10071 - in /branches/6.5/server: Changelog6.html
Slim/Music/Import.pm scanner.pl
dsully at svn.slimdevices.com
dsully at svn.slimdevices.com
Wed Sep 27 17:28:45 PDT 2006
Author: dsully
Date: Wed Sep 27 17:28:43 2006
New Revision: 10071
URL: http://svn.slimdevices.com?rev=10071&view=rev
Log:
Bug: 4116
Description: Merge from trunk -r 10069:10070
Modified:
branches/6.5/server/Changelog6.html
branches/6.5/server/Slim/Music/Import.pm
branches/6.5/server/scanner.pl
Modified: branches/6.5/server/Changelog6.html
URL: http://svn.slimdevices.com/branches/6.5/server/Changelog6.html?rev=10071&r1=10070&r2=10071&view=diff
==============================================================================
--- branches/6.5/server/Changelog6.html (original)
+++ branches/6.5/server/Changelog6.html Wed Sep 27 17:28:43 2006
@@ -6,6 +6,7 @@
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=3318">#3318</a> - MusicMagic: Songs with national chars get duplicated</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4071">#4071</a> - Band Names in mp3 Tags don't always work</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4077">#4077</a> - CUE files YEAR and GENRE not always working</li>
+ <li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4116">#4116</a> - "Rescan done" sent prematurely (before rescan is done!)</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4140">#4140</a> - Problem with the scanner parsing cue sheets in6.5b3</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4142">#4142</a> - ExBrowse3 does not work with Safari</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4145">#4145</a> - Display station name instead of album name in overlay text visualizers on transporter second screen</li>
Modified: branches/6.5/server/Slim/Music/Import.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Slim/Music/Import.pm?rev=10071&r1=10070&r2=10071&view=diff
==============================================================================
--- branches/6.5/server/Slim/Music/Import.pm (original)
+++ branches/6.5/server/Slim/Music/Import.pm Wed Sep 27 17:28:43 2006
@@ -148,8 +148,11 @@
Proc::Background->new($command, @scanArgs)
);
+ # Update a DB flag, so the server knows we're scanning.
+ $class->setIsScanning(1);
+
# Set a timer to check on the scanning process.
- Slim::Utils::Timers::setTimer(0, (Time::HiRes::time() + 30), \&checkScanningStatus);
+ Slim::Utils::Timers::setTimer(0, (Time::HiRes::time() + 5), \&checkScanningStatus);
return 1;
}
@@ -169,7 +172,7 @@
# Run again if we're still scanning.
if ($class->stillScanning) {
- Slim::Utils::Timers::setTimer(0, (Time::HiRes::time() + 60), \&checkScanningStatus);
+ Slim::Utils::Timers::setTimer(0, (Time::HiRes::time() + 5), \&checkScanningStatus);
} else {
@@ -215,6 +218,32 @@
$last->value($value);
$last->update;
}) };
+}
+
+=head2 setIsScanning( )
+
+Set a flag in the DB to true or false if the scanner is running.
+
+=cut
+
+sub setIsScanning {
+ my $class = shift;
+ my $value = shift;
+
+ eval { Slim::Schema->txn_do(sub {
+
+ my $isScanning = Slim::Schema->rs('MetaInformation')->find_or_create({
+ 'name' => 'isScanning'
+ });
+
+ $isScanning->value($value);
+ $isScanning->update;
+ }) };
+
+ if ($@) {
+
+ errorMsg("Scanner: Failed to update isScanning: [$@]\n");
+ }
}
=head2 runScan( )
Modified: branches/6.5/server/scanner.pl
URL: http://svn.slimdevices.com/branches/6.5/server/scanner.pl?rev=10071&r1=10070&r2=10071&view=diff
==============================================================================
--- branches/6.5/server/scanner.pl (original)
+++ branches/6.5/server/scanner.pl Wed Sep 27 17:28:43 2006
@@ -129,15 +129,15 @@
$::d_server && msg("SlimServer done init...\n");
+ # Take the db out of autocommit mode - this makes for a much faster scan.
+ Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
+
# Flag the database as being scanned.
- setIsScanning(1);
+ Slim::Music::Import->setIsScanning(1);
if ($cleanup) {
Slim::Music::Import->cleanupDatabase(1);
}
-
- # Take the db out of autocommit mode - this makes for a much faster scan.
- Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
if ($wipe) {
@@ -237,25 +237,6 @@
$::d_server && msg("SlimServer Info init...\n");
Slim::Music::Info::init();
-}
-
-sub setIsScanning {
- my $value = shift;
-
- eval { Slim::Schema->txn_do(sub {
-
- my $isScanning = Slim::Schema->rs('MetaInformation')->find_or_create({
- 'name' => 'isScanning'
- });
-
- $isScanning->value($value);
- $isScanning->update;
- }) };
-
- if ($@) {
-
- errorMsg("Scanner: Failed to update isScanning: [$@]\n");
- }
}
sub usage {
@@ -313,12 +294,12 @@
sub cleanup {
- $::d_server && msg("SlimServer cleaning up.\n");
+ $::d_server && msg("SlimServer scanner cleaning up.\n");
# Make sure to flush anything in the database to disk.
if ($INC{'Slim/Schema.pm'}) {
- setIsScanning(0);
+ Slim::Music::Import->setIsScanning(0);
Slim::Schema->forceCommit;
Slim::Schema->disconnect;
More information about the checkins
mailing list