Feature/improve find and scan code

Part of fixing #856 and #858. I'm stilling missing the follow config option, but rest should be more or less done, or at least ready for review.
The message as it is suggests you could skip scanning a particular
directory by making it hidden. Which you can't.
On 16 Oct 2014 13:07, "Thomas Adamcik" <notifications@github.com> wrote:

> In mopidy/local/commands.py:
>
> > @@ -74,9 +74,23 @@ def run(self, args, config):
> >          uris_to_update = set()
> >          uris_to_remove = set()
> >
> > -        file_mtimes = path.find_mtimes(media_dir)
> > +        file_mtimes, file_errors = path.find_mtimes(media_dir)
> > +
> > +        # TODO: Not sure if we want to keep this, but for now lets filter these
> > +        # Could be replaced with passing in a predicate to the find function?
> > +        for name in file_mtimes.keys():
> > +            if b'/.' in name:
> > +                logger.debug('Skipping hidden file/directory: %r', name)
>
> True, with the exception of directories with permission problems showing
> up in the errors. So yes the logging is a bit off. I think the more sane
> approach is to pass in a function which is given each path and then decides
> if we should traverse it.
>
> Though ideally I should just make sure the pipeline handles things like
> .directory files etc nicely and then we wouldn't need to skip anything.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mopidy/mopidy/pull/874/files#r18951227>.
>