Author: mherger
Date: Fri Nov 4 02:53:59 2011
New Revision: 33655
URL: http://svn.slimdevices.com/slim?rev=33655&view=rev
Log:
Bug: 17674
Description: don't run media scanner if no media folder is defined.
Erland/Michael - this should fix the case you're seeing, where the scanner is crashing if you haven't defined any video/photo folder.
Unfortunately it still crashes for me every now and then if I have one of those folders defined. It's most likely an issue in Media::Scan causing the crash.
Modified:
7.7/trunk/server/Slim/Control/Commands.pm
7.7/trunk/server/Slim/Utils/Scanner/LMS.pm
Modified: 7.7/trunk/server/Slim/Control/Commands.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Control/Commands.pm?rev=33655&r1=33654&r2=33655&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Control/Commands.pm (original)
+++ 7.7/trunk/server/Slim/Control/Commands.pm Fri Nov 4 02:53:59 2011
@@ -2521,16 +2521,16 @@
# XXX - we need a better way to handle the async mode, eg. passing the exception list together with the folder list to Media::Scan
my $lms;
$lms = sub {
- Slim::Utils::Scanner::LMS->rescan( shift @dirs, {
- scanName => 'directory',
- progress => 1,
- onFinished => sub {
- if (scalar @dirs) {
+ if (scalar @dirs) {
+ Slim::Utils::Scanner::LMS->rescan( shift @dirs, {
+ scanName => 'directory',
+ progress => 1,
+ onFinished => sub {
# XXX - delay call to self for a second, or we segfault
Slim::Utils::Timers::setTimer(undef, time() + 1, $lms);
- }
- },
- } );
+ },
+ } );
+ }
};
# Audio scan is run first, when done, the LMS scanner is run
Modified: 7.7/trunk/server/Slim/Utils/Scanner/LMS.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Utils/Scanner/LMS.pm?rev=33655&r1=33654&r2=33655&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Utils/Scanner/LMS.pm (original)
+++ 7.7/trunk/server/Slim/Utils/Scanner/LMS.pm Fri Nov 4 02:53:59 2011
@@ -73,11 +73,14 @@
return;
}
- my $dbh = Slim::Schema->dbh;
-
if ( ref $in_paths ne 'ARRAY' ) {
$in_paths = [ $in_paths ];
}
+
+ # bug 17674 - don't continue if there's no path defined
+ return unless @$in_paths;
+
+ my $dbh = Slim::Schema->dbh;
my $paths = [];
for my $p ( @{$in_paths} ) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.