feat: format default program for readability.

This commit is contained in:
redxef 2024-11-11 14:50:09 +01:00
parent 8f832ed224
commit 3c0d8a3809
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -5,14 +5,36 @@ namespace Jellyfin.Plugin.SmartPlaylist {
public PluginConfiguration() { public PluginConfiguration() {
InitialProgram = """ InitialProgram = """
(begin (begin
(define lower (lambda (s) (invoke s "ToLower" nil))) (define lower
(define is-genre (lambda (g g-list) (any (lambda (x) (invoke (lower x) "Contains" (list (lower g)))) g-list))) (lambda (s)
(define is-genre-exact (lambda (g g-list) (find g g-list))) (invoke s "ToLower" nil)))
(define genre-list (lambda nil (let (_g (getitems item "Genres")) (if (null _g) nil (car _g))))) (define is-genre
(define is-favorite (lambda nil (invoke item "IsFavoriteOrLiked" (list user)))) (lambda (g g-list)
(define is-type (lambda (x) (and (haskeys item "GetClientTypeName") (invoke (invoke item "GetClientTypeName" nil) "Equals" (list x))))) (any
(define name-contains (lambda (x) (invoke (lower (car (getitems item "Name"))) "Contains" (list (lower x))))) (lambda (x)
(invoke (lower x) "Contains" (list (lower g))))
g-list)))
(define is-genre-exact
(lambda (g g-list)
(find g g-list)))
(define genre-list
(lambda nil
(let
(_g (getitems item "Genres"))
(if (null _g)
nil
(car _g)))))
(define is-favorite
(lambda nil
(invoke item "IsFavoriteOrLiked" (list user))))
(define is-type
(lambda (x)
(and
(haskeys item "GetClientTypeName")
(invoke (invoke item "GetClientTypeName" nil) "Equals" (list x)))))
(define name-contains
(lambda (x)
(invoke (lower (car (getitems item "Name"))) "Contains" (list (lower x)))))
(define is-favourite is-favorite)) (define is-favourite is-favorite))
"""; """;
} }