From 715a989a5a07b4fd73d196a4748be32b6385fb01 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 1 Sep 2015 21:21:02 +0200 Subject: [PATCH] file: Allow lookup() of any file URI Fixes #1268 --- docs/changelog.rst | 10 ++++++++++ mopidy/file/library.py | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 183dbf37..c66a738e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -63,6 +63,16 @@ Bug fix release. clients, which no longer scan the files twice. (Fixes: :issue:`1260`, PR: :issue:`1261`) +- File: Allow looking up metadata about any ``file://`` URI, just like we did + in Mopidy 1.0.x, where Mopidy-Stream handled ``file://`` URIs. In Mopidy + 1.1.0, Mopidy-File did not allow one to lookup files outside the directories + listed in :confval:`file/media_dir`. This broke Mopidy-Local-SQLite when the + :confval:`local/media_dir` directory was not within one of the + :confval:`file/media_dirs` directories. For browsing of files, we still limit + access to files inside the :confval:`file/media_dir` directories. For lookup, + you can now read metadata for any file you know the path of. (Fixes: + :issue:`1268`, PR: :issue:`1273`) + - Audio: Fix timeout handling in scanner. This regression caused timeouts to expire before it should, causing scans to fail. diff --git a/mopidy/file/library.py b/mopidy/file/library.py index b8531a6e..20ac0632 100644 --- a/mopidy/file/library.py +++ b/mopidy/file/library.py @@ -81,10 +81,6 @@ class FileLibraryProvider(backend.LibraryProvider): logger.debug('Looking up file URI: %s', uri) local_path = path.uri_to_path(uri) - if not self._is_in_basedir(local_path): - logger.warning('Ignoring URI outside base dir: %s', local_path) - return [] - try: result = self._scanner.scan(uri) track = utils.convert_tags_to_track(result.tags).copy(