diff --git a/mopidy/local/commands.py b/mopidy/local/commands.py index f2a7ec24..a182aa25 100644 --- a/mopidy/local/commands.py +++ b/mopidy/local/commands.py @@ -74,9 +74,11 @@ class ScanCommand(commands.Command): uris_to_update = set() uris_to_remove = set() - file_mtimes = path.find_mtimes(media_dir) + file_mtimes, file_errors = path.find_mtimes(media_dir) logger.info('Found %d files in media_dir.', len(file_mtimes)) + # TODO: log file errors + num_tracks = library.load() logger.info('Checking %d tracks from library.', num_tracks) diff --git a/mopidy/utils/path.py b/mopidy/utils/path.py index bad3b6c4..a9187d8f 100644 --- a/mopidy/utils/path.py +++ b/mopidy/utils/path.py @@ -184,7 +184,8 @@ def _find(root, thread_count=10, hidden=True, relative=False): def find_mtimes(root): results, errors = _find(root, hidden=False, relative=False) - return dict((f, int(st.st_mtime)) for f, st in results.iteritems()) + mtimes = dict((f, int(st.st_mtime)) for f, st in results.iteritems()) + return mtimes, errors def check_file_path_is_inside_base_dir(file_path, base_path): diff --git a/tests/audio/test_scan.py b/tests/audio/test_scan.py index 1e352991..2e91ce32 100644 --- a/tests/audio/test_scan.py +++ b/tests/audio/test_scan.py @@ -295,7 +295,8 @@ class ScannerTest(unittest.TestCase): def find(self, path): media_dir = path_to_data_dir(path) - for path in path_lib.find_mtimes(media_dir): + result, errors = path_lib.find_mtimes(media_dir) + for path in result: yield os.path.join(media_dir, path) def scan(self, paths): diff --git a/tests/utils/test_path.py b/tests/utils/test_path.py index b33c6681..51dad2cb 100644 --- a/tests/utils/test_path.py +++ b/tests/utils/test_path.py @@ -215,7 +215,8 @@ class FindMTimesTest(unittest.TestCase): maxDiff = None def find(self, value): - return path.find_mtimes(path_to_data_dir(value)) + result, errors = path.find_mtimes(path_to_data_dir(value)) + return result def test_basic_dir(self): self.assert_(self.find(''))