jellyfin-smart-playlist/examples.md

100 lines
2.6 KiB
Markdown
Raw Normal View History

2024-11-08 20:22:46 +01:00
# Examples
- `Favourite Pop`: A playlist
2024-11-08 20:22:46 +01:00
containing all favourite items of the genre pop.
```
Id: Favourite Pop
Name: Favourite Pop
Program: |
(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)))
2024-11-08 20:22:46 +01:00
```
- `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"))))
```
2024-12-22 21:06:06 +01:00
- `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
```