Author: mherger
Date: Fri Nov 18 08:31:56 2011
New Revision: 33719
URL: http://svn.slimdevices.com/slim?rev=33719&view=rev
Log:
Bug: 17731
Description: only scan playlist folder if a playlist scan is desired.
Modified:
7.7/trunk/server/Slim/Control/Commands.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=33719&r1=33718&r2=33719&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Control/Commands.pm (original)
+++ 7.7/trunk/server/Slim/Control/Commands.pm Fri Nov 18 08:31:56 2011
@@ -2470,7 +2470,8 @@
}
# get our parameters
- my $mode = $request->getParam('_mode') || 'full';
+ my $originalMode;
+ my $mode = $originalMode = $request->getParam('_mode') || 'full';
my $singledir = $request->getParam('_singledir');
if ($singledir) {
@@ -2489,9 +2490,15 @@
if ( $mode eq 'external' ) {
# The old way of rescanning using scanner.pl
my %args = (
- rescan => 1,
cleanup => 1,
);
+
+ if ($originalMode eq 'playlists') {
+ $args{playlists} = 1;
+ }
+ else {
+ $args{rescan} = 1;
+ }
$args{singledir} = $singledir if $singledir;
@@ -2555,6 +2562,16 @@
$audio->();
}
+ elsif ($mode eq 'playlists') {
+ my $playlistdir = Slim::Utils::Misc::getPlaylistDir();
+
+ # XXX until libmediascan supports audio, run the audio scanner now
+ Slim::Utils::Scanner::Local->rescan( $playlistdir, {
+ types => 'list',
+ scanName => 'playlist',
+ progress => 1,
+ } );
+ }
else {
my $audiodirs = Slim::Utils::Misc::getAudioDirs();
@@ -2564,8 +2581,8 @@
# XXX until libmediascan supports audio, run the audio scanner now
Slim::Utils::Scanner::Local->rescan( $audiodirs, {
- types => $mode eq 'playlists' ? 'list' : 'list|audio',
- scanName => $mode eq 'playlists' ? 'playlist' : 'directory',
+ types => 'list|audio',
+ scanName => 'directory',
progress => 1,
} );
}
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.