Index: Slim/Music/Info.pm =================================================================== --- Slim/Music/Info.pm (revision 13549) +++ Slim/Music/Info.pm (working copy) @@ -1195,6 +1195,15 @@ # Remove the anchor if we're checking the suffix. my ($type, $anchorlessPath); + my $filepath; + + if (isFileURL($fullpath)) { + $filepath = Slim::Utils::Misc::pathFromFileURL($fullpath); + } else { + $filepath = $fullpath; + } + + if ($fullpath && $fullpath !~ /\x00/) { # Return quickly if we have it in the cache. @@ -1214,6 +1223,11 @@ # Force mp3 for protocol handlers return 'mp3'; } + elsif (-d $filepath) { + # We want to test here if this a dir, before typeFromSuffix thinks + # it is a valid file instead of a dir with a recognized suffix. + $type = 'dir'; + } else { $anchorlessPath = Slim::Utils::Misc::stripAnchorFromURL($fullpath); @@ -1230,14 +1244,6 @@ # We didn't get a type from above - try a little harder. if ((!defined($type) || $type eq 'unk') && $fullpath && $fullpath !~ /\x00/) { - my $filepath; - - if (isFileURL($fullpath)) { - $filepath = Slim::Utils::Misc::pathFromFileURL($fullpath); - } else { - $filepath = $fullpath; - } - if ($filepath) { $anchorlessPath = Slim::Utils::Misc::stripAnchorFromURL($filepath); @@ -1255,10 +1261,6 @@ $type = typeFromSuffix($anchorlessPath, $defaultType); } - } elsif (-d $filepath) { - - $type = 'dir'; - } else { # file doesn't exist, go ahead and do typeFromSuffix