From 0a5aed38ebcfae418d573b5e9f0fc127e230fc44 Mon Sep 17 00:00:00 2001 From: redxef Date: Thu, 7 Nov 2024 22:20:19 +0100 Subject: [PATCH] fix: evaluation of object method invocation. --- Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs b/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs index b9db4d5..495c46a 100644 --- a/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs +++ b/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs @@ -188,7 +188,20 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp { if (mi == null) { throw new ApplicationException($"{o.Value()} has not method {s.Value()}"); } - return Object.FromBase(mi.Invoke(o.Value(), (object?[]?) l.ToList().ToArray())); + object?[]? l_ = l.ToList().Select(x => { + switch (x) { + case Integer s: + return s.Value(); + case Boolean b: + return b.Value(); + case Object o: + return o.Value(); + case Cons c: + return c.ToList().ToList(); + } + return null; + }).ToArray(); + return Object.FromBase(mi.Invoke(o.Value(), l_)); } }