Index: /Users/mh/Documents/workspace/7.3/server/Slim/Utils/Misc.pm =================================================================== --- /Users/mh/Documents/workspace/7.3/server/Slim/Utils/Misc.pm (revision 22763) +++ /Users/mh/Documents/workspace/7.3/server/Slim/Utils/Misc.pm (working copy) @@ -847,6 +847,8 @@ } my %_ignoredItems; +# the hash's value is the parent path from which a file should be excluded +# 1 means "from all folders", "/" -> "subfolders in root only" etc. if (Slim::Utils::OSDetect::OS() eq 'mac') { %_ignoredItems = ( @@ -851,7 +853,7 @@ if (Slim::Utils::OSDetect::OS() eq 'mac') { %_ignoredItems = ( # Items we should ignore on a mac volume - 'Icon' => 1, + 'Icon' => '/', 'TheVolumeSettingsFolder' => 1, 'TheFindByContentFolder' => 1, 'Network Trash Folder' => 1, @@ -863,19 +865,19 @@ '.DS_Store' => 1, # Dean: "Essentially hide anything you can't see in the finder or explorer" 'automount' => 1, - 'cores' => 1, - 'bin' => 1, - 'dev' => 1, - 'etc' => 1, - 'home' => 1, - 'net' => 1, -# 'Network' => 1, - 'private' => 1, + 'cores' => '/', + 'bin' => '/', + 'dev' => '/', + 'etc' => '/', + 'home' => '/', + 'net' => '/', + 'Network' => '/', + 'private' => '/', 'sbin' => 1, 'tmp' => 1, 'usr' => 1, - 'var' => 1, - 'opt' => 1, + 'var' => '/', + 'opt' => '/', ) } @@ -882,9 +884,9 @@ elsif (Slim::Utils::OSDetect::OS() eq 'win') { %_ignoredItems = ( # Items we should ignore on a Windows volume - 'System Volume Information' => 1, - 'RECYCLER' => 1, - 'Recycled' => 1, + 'System Volume Information' => '/', + 'RECYCLER' => '/', + 'Recycled' => '/', ) } @@ -897,8 +899,8 @@ } # always ignore . and .. -$_ignoredItems{'.'} = 1; -$_ignoredItems{'..'} = 1; +$_ignoredItems{'.'} = 1; +$_ignoredItems{'..'} = 1; # Don't include old Shoutcast recently played items. $_ignoredItems{'ShoutcastBrowser_Recently_Played'} = 1; @@ -916,7 +918,20 @@ my $item = shift; my $validRE = shift || Slim::Music::Info::validTypeExtensions(); - return 0 if exists $_ignoredItems{$item}; + if (my $filter = $_ignoredItems{$item}) { + + # '1' items are always to be ignored + return 0 if $filter eq '1'; + + my @parts = splitpath($dirname); + if ($parts[1]) { + # replace back slashes on Windows + $parts[1] =~ s/\\/\//g; + + return 0 if $filter eq $parts[1]; + } + } + # Ignore special named files and directories # __ is a match against our old __history and __mac playlists.