From f06a16819f860a87a6b01b36760141efd9351ec4 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 7 Mar 2014 14:26:49 -0800 Subject: [PATCH] spl mutli-query (#575): remove option, changelog --- beetsplug/smartplaylist.py | 8 +------- docs/changelog.rst | 2 ++ docs/plugins/smartplaylist.rst | 6 ++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/beetsplug/smartplaylist.py b/beetsplug/smartplaylist.py index e1eb2075e..40a5d7305 100644 --- a/beetsplug/smartplaylist.py +++ b/beetsplug/smartplaylist.py @@ -35,10 +35,6 @@ def update_playlists(lib): relative_to = normpath(relative_to) for playlist in playlists: - # Default is to not keep_duplicate - keep_duplicate = playlist.has_key('keep_duplicate') and \ - playlist['keep_duplicate'] - # Query attribute could be a single query or a list of queries queries = playlist['query'] if not isinstance(queries, (list, tuple)): @@ -58,9 +54,7 @@ def update_playlists(lib): item_path = item.path if relative_to: item_path = os.path.relpath(item.path, relative_to) - # Check if we want to add the item. - if keep_duplicate or not item_path in m3us[m3u_name]: - m3us[m3u_name].append(item_path) + m3us[m3u_name].append(item_path) # Now iterate through the m3us that we need to generate for m3u in m3us: m3u_path = normpath(os.path.join(playlist_dir, m3u)) diff --git a/docs/changelog.rst b/docs/changelog.rst index 2ad9999f8..403fcbb6a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -14,6 +14,8 @@ New stuff: fields. Thanks to geigerzaehler. * The importer interface now shows the URL for MusicBrainz matches. Thanks to johtso. +* :doc:`/plugins/smartplaylist`: Playlists can now be generated from multiple + queries (combined with "or" logic). Thanks to brilnius. Fixes: diff --git a/docs/plugins/smartplaylist.rst b/docs/plugins/smartplaylist.rst index 7b8dfb036..0ee62eb92 100644 --- a/docs/plugins/smartplaylist.rst +++ b/docs/plugins/smartplaylist.rst @@ -44,13 +44,11 @@ For more advanced usage, you can use template syntax (see This will query all the songs in 2010 and 2011 and generate the two playlist files `ReleasedIn2010.m3u` and `ReleasedIn2011.m3u` using those songs. -You can also gather the results of several queries by putting them in a list. By -default duplicates are removed, but you can keep all of them with the -``keep_duplicate: yes`` additional directive. For example:: +You can also gather the results of several queries by putting them in a list. +(Items that match both queries are not included twice.) For example:: - query: ['artist:beatles', 'genre:"beatles cover"'] name: 'BeatlesUniverse.m3u' - keep_duplicate: yes By default, all playlists are regenerated after every beets command that changes the library database. To force regeneration, you can invoke it manually