diff --git a/mopidy/file/library.py b/mopidy/file/library.py index c20b92b6..1181d7e7 100644 --- a/mopidy/file/library.py +++ b/mopidy/file/library.py @@ -59,6 +59,9 @@ class FileLibraryProvider(backend.LibraryProvider): uri = path.path_to_uri(child_path) printable_path = child_path.decode(FS_ENCODING, 'replace') + if not self._show_dotfiles and dir_entry.startswith(b'.'): + continue + if os.path.islink(child_path) and not self._follow_symlinks: logger.debug('Ignoring symlink: %s', printable_path) continue @@ -68,9 +71,6 @@ class FileLibraryProvider(backend.LibraryProvider): printable_path) continue - if not self._show_dotfiles and dir_entry.startswith(b'.'): - continue - name = dir_entry.decode(FS_ENCODING, 'replace') if os.path.isdir(child_path): result.append(models.Ref.directory(name=name, uri=uri))