fix: evaluation of object method invocation.

This commit is contained in:
redxef 2024-11-07 22:20:19 +01:00
parent 8ec393f494
commit 0a5aed38eb
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921

View file

@ -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<Expression, object?>(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_));
}
}