From 4cae6ea64593a716097ef73e5765024e12648f56 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 27 Aug 2015 15:27:59 +0200 Subject: [PATCH 1/6] docs: ToC captions requires Sphinx 1.3 --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index cc760720..cbb2f228 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -78,7 +78,7 @@ def setup(app): # -- General configuration ---------------------------------------------------- -needs_sphinx = '1.0' +needs_sphinx = '1.3' extensions = [ 'sphinx.ext.autodoc', From 0360936135ef8193cc2b508cecb766e943b1294e Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 28 Aug 2015 22:03:58 +0200 Subject: [PATCH 2/6] docs: Add a section on updating the local library Fixes #1267 --- docs/ext/local.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/ext/local.rst b/docs/ext/local.rst index d6e3b56a..ef9df5d7 100644 --- a/docs/ext/local.rst +++ b/docs/ext/local.rst @@ -35,6 +35,23 @@ To make a local library for your music available for Mopidy: #. Start Mopidy, find the music library in a client, and play some local music! +Updating the local library +========================== + +When you've added or removed music in your collection and want to update +Mopidy's index of your local library, you need to rescan:: + + mopidy local scan + +Note that if you are using the default local library storage, ``json``, you +need to restart Mopidy after the scan completes for the updated index to be +used. + +If you want index updates to come into effect immediately, you can try out +`Mopidy-Local-SQLite `_, which +will probably become the default backend in the near future. + + Pluggable library support ========================= From fcfb1515b13de427f173f3b91fffb0e4e84ee943 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 28 Aug 2015 22:20:52 +0200 Subject: [PATCH 3/6] local: Lower the default scan_flush_threshold @tkem recommends that this is reduced from 1000 to maximum 100 to not block incoming requests to Mopidy-Local-SQLite for too long while scanning the local library. --- docs/changelog.rst | 4 ++++ mopidy/local/ext.conf | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 741956b9..a507002e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -29,6 +29,10 @@ Bug fix release. :confval:`core/data_dir`, like the Debian and Arch packages. (Fixes: :issue:`1259`, PR: :issue:`1266`) +- Local: Change default value of :confval:`local/scan_flush_threshold` from + 1000 to 100 to shorten the time Mopidy-Local-SQLite blocks incoming requests + while scanning the local library. + - M3U: Changed default for the :confval:`m3u/playlists_dir` from ``$XDG_DATA_DIR/mopidy/m3u`` to unset, which now means the extension's data dir. This does not change the defaults for desktop users, only system diff --git a/mopidy/local/ext.conf b/mopidy/local/ext.conf index 6dd29147..b37a3a7a 100644 --- a/mopidy/local/ext.conf +++ b/mopidy/local/ext.conf @@ -3,7 +3,7 @@ enabled = true library = json media_dir = $XDG_MUSIC_DIR scan_timeout = 1000 -scan_flush_threshold = 1000 +scan_flush_threshold = 100 scan_follow_symlinks = false excluded_file_extensions = .directory From b480de77e1d7695ca74f345793376c3528c3b15e Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 1 Sep 2015 15:32:21 +0200 Subject: [PATCH 4/6] core: Fix docstring error Fixes #1269 --- docs/changelog.rst | 5 ++++- mopidy/core/tracklist.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a507002e..183dbf37 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -23,6 +23,9 @@ Bug fix release. :file:`/var/lib/mopidy/.local` and :file:`/var/lib/mopidy/.cache`. (Fixes: :issue:`1259`, PR: :issue:`1266`) +- Core: Fix error in :meth:`~mopidy.core.TracklistController.get_eot_tlid` + docstring. (Fixes: :issue:`1269`) + - Local: Deprecate :confval:`local/data_dir` and respect :confval:`core/data_dir` instead. This does not change the defaults for desktop users, only system services installed from packages that properly set @@ -126,7 +129,7 @@ Core API - Add ``tlid`` alternatives to methods that take ``tl_track`` and also add ``get_{eot,next,previous}_tlid`` methods as light weight alternatives to the - ``tl_track`` versions of the calls. (Fixes: :issue:`1131` PR: :issue:`1136`, + ``tl_track`` versions of the calls. (Fixes: :issue:`1131`, PR: :issue:`1136`, :issue:`1140`) - Add :meth:`mopidy.core.PlaybackController.get_current_tlid`. diff --git a/mopidy/core/tracklist.py b/mopidy/core/tracklist.py index db4e2a69..13efe322 100644 --- a/mopidy/core/tracklist.py +++ b/mopidy/core/tracklist.py @@ -236,7 +236,7 @@ class TracklistController(object): def get_eot_tlid(self): """ - The TLID of the track that will be played after the given track. + The TLID of the track that will be played after the current track. Not necessarily the same TLID as returned by :meth:`get_next_tlid`. @@ -332,7 +332,7 @@ class TracklistController(object): def get_previous_tlid(self): """ - Returns the TLID of the track that will be played if calling + Returns the TLID of the track that will be played if calling :meth:`mopidy.core.PlaybackController.previous()`. For normal playback this is the previous track in the tracklist. If From 715a989a5a07b4fd73d196a4748be32b6385fb01 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 1 Sep 2015 21:21:02 +0200 Subject: [PATCH 5/6] 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( From 9957b3c2be965c7c5387230575eb7fe17efcdcf5 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 1 Sep 2015 23:27:39 +0200 Subject: [PATCH 6/6] local: Reintroduce local/data_dir config for the 1.1.x series As to not break compat with mopidy-local-* in v1.1.1. --- mopidy/local/__init__.py | 2 +- mopidy/local/ext.conf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mopidy/local/__init__.py b/mopidy/local/__init__.py index 3ee2703e..552e5341 100644 --- a/mopidy/local/__init__.py +++ b/mopidy/local/__init__.py @@ -23,7 +23,7 @@ class Extension(ext.Extension): schema = super(Extension, self).get_config_schema() schema['library'] = config.String() schema['media_dir'] = config.Path() - schema['data_dir'] = config.Deprecated() + schema['data_dir'] = config.Path(optional=True) schema['playlists_dir'] = config.Deprecated() schema['tag_cache_file'] = config.Deprecated() schema['scan_timeout'] = config.Integer( diff --git a/mopidy/local/ext.conf b/mopidy/local/ext.conf index b37a3a7a..c8fe6b86 100644 --- a/mopidy/local/ext.conf +++ b/mopidy/local/ext.conf @@ -2,6 +2,7 @@ enabled = true library = json media_dir = $XDG_MUSIC_DIR +data_dir = $XDG_DATA_DIR/mopidy/local scan_timeout = 1000 scan_flush_threshold = 100 scan_follow_symlinks = false