diff --git a/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs b/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs index df40feb..265ecd5 100644 --- a/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs +++ b/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs @@ -113,7 +113,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp { public class Builtins : Dictionary { - private static Dictionary AssemblyMapping = new Dictionary(); + private static Dictionary ResolvedTypes = new Dictionary(); public Builtins() : base() { this["atom"] = _atom; @@ -261,12 +261,17 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp { } private static Type? GetType(string name) { - return Type.GetType( + if (ResolvedTypes.ContainsKey(name)) { + return ResolvedTypes[name]; + } + var t = Type.GetType( name, (name) => { return AppDomain.CurrentDomain.GetAssemblies().Where(z => (z.FullName != null) && z.FullName.StartsWith(name.FullName)).FirstOrDefault(); }, null, true ); + ResolvedTypes[name] = t; + return t; } private static Expression _invoke_generic(IEnumerable args) {