From af540aee37c98a94188dbb63306d42a4871744c9 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 26 Aug 2016 05:12:45 -0700 Subject: [PATCH] Do not scan first-level dirs starting with . - Currently the code skips directories with level > 1 starting with ., but does not skip first-level directories starting with .; fix this by matching for files/directories which start with . in addition to those that contain /. --- mopidy/local/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mopidy/local/commands.py b/mopidy/local/commands.py index ead874a0..862d1d0b 100644 --- a/mopidy/local/commands.py +++ b/mopidy/local/commands.py @@ -118,7 +118,7 @@ class ScanCommand(commands.Command): relpath = os.path.relpath(abspath, media_dir) uri = translator.path_to_local_track_uri(relpath) - if b'/.' in relpath: + if b'/.' in relpath or relpath.startswith(b'.'): logger.debug('Skipped %s: Hidden directory/file.', uri) elif relpath.lower().endswith(excluded_file_extensions): logger.debug('Skipped %s: File extension excluded.', uri)