fix: evaluation of object method invocation.
This commit is contained in:
parent
8ec393f494
commit
0a5aed38eb
1 changed files with 14 additions and 1 deletions
|
@ -188,7 +188,20 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp {
|
||||||
if (mi == null) {
|
if (mi == null) {
|
||||||
throw new ApplicationException($"{o.Value()} has not method {s.Value()}");
|
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_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue