From d593bf85978646db6ade425e2488e8d992e20dbd Mon Sep 17 00:00:00 2001 From: redxef Date: Sun, 22 Dec 2024 21:06:06 +0100 Subject: [PATCH] docs: add a more complex example. --- examples.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/examples.md b/examples.md index 6abbd21..d50371e 100644 --- a/examples.md +++ b/examples.md @@ -53,3 +53,47 @@ (t (string= (car (getitems parent "Name")) "Seeed")))) ``` + +- `Artists`: A playlist including everything from a list of artists. + ``` + Id: Artists + Name: Artists + Program: >- + (begin + (define *include-artists* '( + "seeed" + "juli" + "falco" + "peter fox" + "alligatoah" + "kraftklub" + "wanda" + "annennaykantereit" + "feine sahne fischfilet" + "madsen" + "wiener blond" + "die toten hosen" + "die ärzte" + "wir sind helden" + )) + (define my-prefilter-only-tracks + (lambda nil + (and + (is-type "Audio") + (not (name-contains "live")) + (not (name-contains "acoustic")) + (not (name-contains "instrumental")) + (not (name-contains "remix"))))) + (and + (my-prefilter-only-tracks) + (is-favourite) + (any + (lambda + (i) + ;; the `(and (find-artist)` is here to prevent null violations. + (and (find-artist) (string= i (lower (get-name (find-artist)))))) + *include-artists*))) + SortProgram: (begin (shuf *items*)) + Filename: /config/data/smartplaylists/German.yaml + Enabled: true + ```