From fef10b5736c867236b947696ea785c7e0e65d7de Mon Sep 17 00:00:00 2001 From: redxef Date: Mon, 20 Jan 2025 20:59:47 +0100 Subject: [PATCH] feat: add length function. --- Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs b/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs index d16f46d..8cc0225 100644 --- a/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs +++ b/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs @@ -74,6 +74,13 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp { (cons (cons (car lst) (car s)) (cdr s))))) """ ); + this["length"] = e.eval( + """ + (lambda + (lst n) + (if (null lst) n (length (cdr lst) (+ n 1)))) + """ + ); this["qsort"] = e.eval( """ (lambda