From 3f1a1e1a78eea005b454badab1f9c7ac9fb12525 Mon Sep 17 00:00:00 2001 From: redxef Date: Tue, 17 Dec 2024 18:09:39 +0100 Subject: [PATCH] docs: add barebones example on how to find items by a specific artist. --- examples.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/examples.md b/examples.md index 6e92d6d..fce34bb 100644 --- a/examples.md +++ b/examples.md @@ -25,3 +25,31 @@ (is-genre "electro" g) (is-genre "swing" g))) ``` + +- `All of Seeed`: A playlist containing all items by artist `Seeed`, + useless, since you also can just navigate to the artist to play all + their songs, but a good example. + ``` + Id: Seeed + Name: Seeed + Program: | + (let + (parent + (invoke-generic item "FindParent" nil (list "MediaBrowser.Controller.Entities.Audio.MusicArtist, MediaBrowser.Controller"))) + (cond + ((null parent) nil) + (t (string= (car (getitems parent "Name")) "Haller")))) + ``` + or simplified with definitions contained in the preamble: + ``` + Id: Seeed + Name: Seeed + Program: | + (let + (parent + (find-parent "MediaBrowser.Controller.Entities.Audio.MusicArtist, MediaBrowser.Controller")) + (cond + ((null parent) nil) + (t (string= (car (getitems parent "Name")) "Seeed")))) + + ```