From 0f671516ed129d4b51fac2eec88272d6ed56b314 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sat, 28 Dec 2013 00:00:10 +0100 Subject: [PATCH] local: Make sure excluded file extension case does not error out --- mopidy/backends/local/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mopidy/backends/local/commands.py b/mopidy/backends/local/commands.py index 63970c2d..60bc8ad4 100644 --- a/mopidy/backends/local/commands.py +++ b/mopidy/backends/local/commands.py @@ -64,12 +64,13 @@ class ScanCommand(commands.Command): logger.info('Checking %s for unknown tracks.', media_dir) for relpath in path.find_files(media_dir): + uri = translator.path_to_local_track_uri(relpath) file_extension = os.path.splitext(relpath)[1] + if file_extension.lower() in excluded_file_extensions: logger.debug('Skipped %s: File extension excluded.', uri) continue - uri = translator.path_to_local_track_uri(relpath) if uri not in uris_in_library: uris_to_update.add(uri) uri_path_mapping[uri] = os.path.join(media_dir, relpath)