private static bool LoadScript(string dbId) { string scriptFileName = ScriptDirectory + @"\" + dbId + ".csscript"; // Script support script.csscript if (!File.Exists(scriptFileName)) { Log.Error("InfoGrabber LoadScript() - grabber script not found: {0}", scriptFileName); return(false); } try { Environment.CurrentDirectory = Config.GetFolder(Config.Dir.Base); _asmHelper = new AsmHelper(CSScript.Load(scriptFileName, null, false)); _grabber = (IIMDBScriptGrabber)_asmHelper.CreateObject("Grabber"); } catch (Exception ex) { Log.Error("InfoGrabber LoadScript() - file: {0}, message : {1}", scriptFileName, ex.Message); return(false); } return(true); }
public static void ResetGrabber() { if (_asmHelper != null) { _asmHelper.Dispose(); _asmHelper = null; } if (_grabber != null) { _grabber.SafeDispose(); _grabber = null; } _grabbers.Clear(); }
public bool LoadScript() { string scriptFileName = ScriptDirectory + @"\" + ID + ".csscript"; // Script support script.csscript if (!File.Exists(scriptFileName)) { Log.Error("InfoGrabber LoadScript() - grabber script not found: {0}", scriptFileName); return false; } try { Environment.CurrentDirectory = Config.GetFolder(Config.Dir.Base); AsmHelper script = new AsmHelper(CSScript.Load(scriptFileName, null, false)); Grabber = (IIMDBScriptGrabber)script.CreateObject("Grabber"); } catch (Exception ex) { Log.Error("InfoGrabber LoadScript() - file: {0}, message : {1}", scriptFileName, ex.Message); return false; } return true; }