local: Add follow symlinks setting

This commit is contained in:
Thomas Adamcik 2014-10-17 20:08:33 +02:00
parent 369edab76d
commit b9a7a9d2b6
4 changed files with 8 additions and 1 deletions

View File

@ -86,6 +86,10 @@ See :ref:`config` for general help on configuring Mopidy.
Number of milliseconds before giving up scanning a file and moving on to
the next file.
.. confval:: local/scan_follow_symlinks
If we should follow symlinks found in :confval:`local/media_dir`
.. confval:: local/scan_flush_threshold
Number of tracks to wait before telling library it should try and store

View File

@ -29,6 +29,7 @@ class Extension(ext.Extension):
schema['scan_timeout'] = config.Integer(
minimum=1000, maximum=1000*60*60)
schema['scan_flush_threshold'] = config.Integer(minimum=0)
schema['scan_follow_symlinks'] = config.Boolean()
schema['excluded_file_extensions'] = config.List(optional=True)
return schema

View File

@ -74,7 +74,8 @@ class ScanCommand(commands.Command):
uris_to_update = set()
uris_to_remove = set()
file_mtimes, file_errors = path.find_mtimes(media_dir)
file_mtimes, file_errors = path.find_mtimes(
media_dir, follow=config['local']['scan_follow_symlinks'])
logger.info('Found %d files in media_dir.', len(file_mtimes))

View File

@ -6,6 +6,7 @@ data_dir = $XDG_DATA_DIR/mopidy/local
playlists_dir = $XDG_DATA_DIR/mopidy/local/playlists
scan_timeout = 1000
scan_flush_threshold = 1000
scan_follow_symlinks = false
excluded_file_extensions =
.directory
.html