[Slim-Checkins] r33730 - in /7.7/trunk/server: Changelog7.html Slim/Utils/Prefs.pm

[email protected]
Newsgroups gmane.music.equipment.slimdevices.cvs
Message-ID <[email protected]>
Author: mherger
Date: Tue Nov 22 07:32:37 2011
New Revision: 33730

URL: http://svn.slimdevices.com/slim?rev=33730&view=rev
Log:
Fixed Bug: 17781
Description: don't trigger full wipecache when a new folder with an media exception rule is added. Only removing data from the db requires the wipecache.

Modified:
    7.7/trunk/server/Changelog7.html
    7.7/trunk/server/Slim/Utils/Prefs.pm

Modified: 7.7/trunk/server/Changelog7.html
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Changelog7.html?rev=33730&r1=33729&r2=33730&view=diff
==============================================================================
--- 7.7/trunk/server/Changelog7.html (original)
+++ 7.7/trunk/server/Changelog7.html Tue Nov 22 07:32:37 2011
@@ -31,6 +31,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17752">#17752</a> - OSX PrefPane is missing localizations</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17762">#17762</a> - Control Panel Doesn't Open after Entering Credentials</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17764">#17764</a> - Embedded LMS fails to switch between sources</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=17781">#17781</a> - Full wipecache is run when adding new folder with media type exclusion</li>
 	</ul>
 	<br />
 </ul>

Modified: 7.7/trunk/server/Slim/Utils/Prefs.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Utils/Prefs.pm?rev=33730&r1=33729&r2=33730&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Utils/Prefs.pm (original)
+++ 7.7/trunk/server/Slim/Utils/Prefs.pm Tue Nov 22 07:32:37 2011
@@ -856,8 +856,15 @@
 
 			# in order to get rid of stale entries trigger full rescan if path has been added
 			if (scalar @new) {
-				main::INFOLOG && logger('scan.scanner')->info('added folder to exclusion list - trigger wipecache: ' . Data::Dump::dump(@new));
-				Slim::Control::Request::executeRequest(undef, ['wipecache']);
+				my %mediadirs = map { $_ => 1 } @{ Slim::Utils::Misc::getMediaDirs() };
+
+				if (!scalar grep { $mediadirs{$_} } @new) {
+					main::INFOLOG && logger('scan.scanner')->info("added folder to exclusion list which is not in mediadirs yet - don't trigger scan: " . Data::Dump::dump(@new));
+				}
+				else {
+					main::INFOLOG && logger('scan.scanner')->info('added folder to exclusion list - trigger wipecache: ' . Data::Dump::dump(@new));
+					Slim::Control::Request::executeRequest(undef, ['wipecache']);
+				}
 			}
 
 			# if only new paths were added, only scan those folders
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.