mirror of
https://github.com/nzbget/nzbget.git
synced 2026-05-19 02:24:28 -04:00
when logging messages from a post-processing script, a short name of the script is now used as prefix if possible; a short name doesn't include subdirectory name or file extension; RPC-method <configtemplates> returns new field <DisplayName> representing the short name of the script which is recommended for using in UI
This commit is contained in:
@@ -803,7 +803,7 @@ void PostScriptController::Run()
|
||||
// if any script has requested par-check, do not execute other scripts
|
||||
if (Util::SameFilename(pScript->GetName(), szActiveName) && !m_pPostInfo->GetRequestParCheck())
|
||||
{
|
||||
ExecuteScript(pScript->GetName(), pScript->GetLocation());
|
||||
ExecuteScript(pScript->GetName(), pScript->GetDisplayName(), pScript->GetLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -817,7 +817,7 @@ void PostScriptController::Run()
|
||||
m_pPostInfo->SetWorking(false);
|
||||
}
|
||||
|
||||
void PostScriptController::ExecuteScript(const char* szScriptName, const char* szLocation)
|
||||
void PostScriptController::ExecuteScript(const char* szScriptName, const char* szDisplayName, const char* szLocation)
|
||||
{
|
||||
PrintMessage(Message::mkInfo, "Executing post-process-script %s for %s", szScriptName, m_pPostInfo->GetInfoName());
|
||||
|
||||
@@ -829,12 +829,7 @@ void PostScriptController::ExecuteScript(const char* szScriptName, const char* s
|
||||
szInfoName[1024-1] = '\0';
|
||||
SetInfoName(szInfoName);
|
||||
|
||||
char szLogPrefix[1024];
|
||||
strncpy(szLogPrefix, szScriptName, 1024);
|
||||
szLogPrefix[1024-1] = '\0';
|
||||
if (char* ext = strrchr(szLogPrefix, '.')) *ext = '\0'; // strip file extension
|
||||
SetLogPrefix(szLogPrefix);
|
||||
|
||||
SetLogPrefix(szDisplayName);
|
||||
SetDefaultLogKind(g_pOptions->GetProcessLogKind());
|
||||
|
||||
PrepareParams(szScriptName);
|
||||
|
||||
Reference in New Issue
Block a user