From 33632e0caf9d90b503169a09347236466ac638a6 Mon Sep 17 00:00:00 2001 From: Bruno Tournay Date: Sun, 9 Mar 2014 22:56:27 +0100 Subject: [PATCH 1/3] We can now disable auto regeneration of smartplaylist --- beetsplug/smartplaylist.py | 4 +++- docs/plugins/smartplaylist.rst | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/beetsplug/smartplaylist.py b/beetsplug/smartplaylist.py index dae5561fb..3813afc53 100644 --- a/beetsplug/smartplaylist.py +++ b/beetsplug/smartplaylist.py @@ -96,6 +96,7 @@ class SmartPlaylistPlugin(BeetsPlugin): self.config.add({ 'relative_to': None, 'playlist_dir': u'.', + 'auto': True, 'playlists': [] }) @@ -116,5 +117,6 @@ def handle_change(lib): @SmartPlaylistPlugin.listen('cli_exit') def update(lib): - if database_changed: + auto = config['smartplaylist']['auto'].get(bool) + if database_changed and auto: update_playlists(lib) diff --git a/docs/plugins/smartplaylist.rst b/docs/plugins/smartplaylist.rst index 05a1c8c7a..42e014a8e 100644 --- a/docs/plugins/smartplaylist.rst +++ b/docs/plugins/smartplaylist.rst @@ -59,9 +59,10 @@ to albums that have a ``for_travel`` extensible field set to 1:: album_query: 'for_travel:1' query: 'for_travel:1' -By default, all playlists are regenerated after every beets command that -changes the library database. To force regeneration, you can invoke it manually -from the command line:: +By default, all playlists are automatically regenerated after every beets +command that changes the library database. This can be disabled by specifying +``auto: no``. To force regeneration, you can invoke it manually from the +command line:: $ beet splupdate From 865ea40eaba09cb2d95104e496038f68dbd80fe1 Mon Sep 17 00:00:00 2001 From: Bruno Tournay Date: Mon, 10 Mar 2014 22:44:38 +0100 Subject: [PATCH 2/3] Simplified config access --- beetsplug/smartplaylist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/smartplaylist.py b/beetsplug/smartplaylist.py index 3813afc53..195f94632 100644 --- a/beetsplug/smartplaylist.py +++ b/beetsplug/smartplaylist.py @@ -117,6 +117,6 @@ def handle_change(lib): @SmartPlaylistPlugin.listen('cli_exit') def update(lib): - auto = config['smartplaylist']['auto'].get(bool) + auto = config['smartplaylist']['auto'] if database_changed and auto: update_playlists(lib) From 0d2f18efb5588158632918c38c78dd83023ac1ee Mon Sep 17 00:00:00 2001 From: Bruno Tournay Date: Mon, 10 Mar 2014 22:45:27 +0100 Subject: [PATCH 3/3] Added mention that smartplaylist auto-regeneration can be disabled --- docs/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 28cdb4cf8..bb5a1f71f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,7 +21,8 @@ New stuff: johtso. * :doc:`/plugins/smartplaylist`: Playlists can now be generated from multiple queries (combined with "or" logic). Album-level queries are also now - possible. Thanks to brilnius. + possible. Automatic playlist regeneration can now be disabled. Thanks to + brilnius. * :doc:`/plugins/echonest`: Echo Nest similarity now weights the tempo in better proportion to other metrics. Also, options were added to specify custom thresholds and output formats. Thanks to Adam M.