From af63a8a696f6b0c685cacea6af1988f23fc2235b Mon Sep 17 00:00:00 2001 From: redxef Date: Fri, 8 Nov 2024 22:50:38 +0100 Subject: [PATCH] docs: itemkind behavior and filtering warning, also extend examples. --- README.md | 8 ++++++++ examples.md | 21 +++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0df08be..7fb6c96 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,14 @@ A lisp program to decide on a per item basis if it should be included in the playlist, return `nil` to not include items, return any other value to include them. +**!!! The filter expression will include all items matching, if you do +not specify the kind of item to include/exclude all of them will be +added. Should you allow a playlist to be included all of it's items +will be added to the generated playlist !!!** + +It's best to be explicit and always specify the item kinds you want to +include: `(and (or (is-type "MusicAlbum") (is-type "Audio")) . rest of filter)`. + The configuration page defines some useful functions to make it easier to create filters. The above filter for liked items could be simplified to: `(is-favourite)`. diff --git a/examples.md b/examples.md index 6855cf9..6e92d6d 100644 --- a/examples.md +++ b/examples.md @@ -1,10 +1,27 @@ # Examples -* `Favourite Pop`: A Playlist +- `Favourite Pop`: A playlist containing all favourite items of the genre pop. ``` Id: Favourite Pop Name: Favourite Pop Program: | - (and (is-favorite) (is-genre "pop" (genre-list))) + (and (is-type "Audio") (is-favorite) (is-genre "pop" (genre-list))) + ``` +- `Electro Swing`: A playlist containing all items + which have a genre that contains "electro" and a + genre that contains "swing". It will only include + albums and single tracks. + ``` + Id: Electro Swing + Name: Electro Swing + Program: | + (let + (g (genre-list)) + (and + (or + (is-type "Audio") + (is-type "MusicAlbum")) + (is-genre "electro" g) + (is-genre "swing" g))) ```