mirror of
https://github.com/nzbget/nzbget.git
synced 2026-04-29 00:52:37 -04:00
the list of scripts (pp-scripts, queue-scripts, etc.) is now read once on program start instead of reading everytime a script is executed; that eliminates the unnecessary disk access; the list of post-processing parameters shown on page "Postprocess" of download details dialog is now built using the preloaded list of scripts instead of reading the script config sections on every load of web-interface; the settings page of web-interface loads available scripts every time the page is shown; this allows to configure newly added scripts without restarting the program first (just like it was before); a restart is still required to apply the settings (just like it was before); RPC-method "configtemplates" has new parameter "loadFromDisk"
This commit is contained in:
@@ -135,10 +135,7 @@ void NZBScriptController::PrepareEnvScript(NZBParameterList* pParameters, const
|
||||
|
||||
void NZBScriptController::ExecuteScriptList(const char* szScriptList)
|
||||
{
|
||||
Options::ScriptList scriptList;
|
||||
g_pOptions->LoadScriptList(&scriptList);
|
||||
|
||||
for (Options::ScriptList::iterator it = scriptList.begin(); it != scriptList.end(); it++)
|
||||
for (Options::Scripts::iterator it = g_pOptions->GetScripts()->begin(); it != g_pOptions->GetScripts()->end(); it++)
|
||||
{
|
||||
Options::Script* pScript = *it;
|
||||
|
||||
@@ -459,10 +456,8 @@ QueueScriptCoordinator::~QueueScriptCoordinator()
|
||||
|
||||
void QueueScriptCoordinator::InitOptions()
|
||||
{
|
||||
g_pOptions->LoadScriptList(&m_ScriptList);
|
||||
|
||||
m_bHasQueueScripts = false;
|
||||
for (Options::ScriptList::iterator it = m_ScriptList.begin(); it != m_ScriptList.end(); it++)
|
||||
for (Options::Scripts::iterator it = g_pOptions->GetScripts()->begin(); it != g_pOptions->GetScripts()->end(); it++)
|
||||
{
|
||||
Options::Script* pScript = *it;
|
||||
if (pScript->GetQueueScript())
|
||||
@@ -509,7 +504,7 @@ void QueueScriptCoordinator::EnqueueScript(NZBInfo* pNZBInfo, EEvent eEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
for (Options::ScriptList::iterator it = m_ScriptList.begin(); it != m_ScriptList.end(); it++)
|
||||
for (Options::Scripts::iterator it = g_pOptions->GetScripts()->begin(); it != g_pOptions->GetScripts()->end(); it++)
|
||||
{
|
||||
Options::Script* pScript = *it;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user