added built-in unpack: 1) rar and 7-zip formats are supported (via external Unrar and 7-Zip executables); 2) new options <Unpack>, <UnpackPauseQueue>, <UnpackCleanupDisk>, <UnrarCmd>, <SevenZipCmd>; 3) web-interface now shows progress and estimated time during unpack (rar only; for 7-Zip progress is not available due to limitations of 7-Zip) 4) when built-in unpack is enabled, the post-processing script is called after unpack and possibly par-check/repair (if needed); 5) for nzb-files containing multiple collections (par-sets) the post-processing script is called only once, after the last par-set; 6) new parameter <NZBPP_UNPACKSTATUS> passed to post-processing script; 7) if the option <AllowReProcess> is enabled the post-processing-script is called after each par-set (as in previous versions); 8) example post-processing script updated: removed unrar-code, added check for unpack status; 9) new field <UnpackStatus> in result of RPC-method <history>; 10) history-dialog in web-interface shows three status: par-status, unpack-status, script-status; 11) with two built-in special post-processing parameters <*Unpack:> and <*Unpack:Password> the unpack can be disabled for individual nzb-file or the password can be set; 12) built-in special post-processing parameters can be set via web-interface on page <PP-Parameters> (when built-in unpack is enabled).

This commit is contained in:
Andrey Prygunkov
2013-02-06 22:04:50 +00:00
parent 68a73f96c4
commit 940448ffae
29 changed files with 1215 additions and 425 deletions

View File

@@ -599,6 +599,42 @@ bool Util::CreateDirectory(const char* szDirFilename)
return DirectoryExists(szDirFilename);
}
bool Util::RemoveDirectory(const char* szDirFilename)
{
#ifdef WIN32
return ::RemoveDirectory(szDirFilename);
#else
return remove(szDirFilename) == 0;
#endif
}
bool Util::DeleteDirectoryWithContent(const char* szDirFilename)
{
bool bOK = true;
DirBrowser dir(szDirFilename);
while (const char* filename = dir.Next())
{
char szFullFilename[1024];
snprintf(szFullFilename, 1024, "%s%c%s", szDirFilename, PATH_SEPARATOR, filename);
szFullFilename[1024-1] = '\0';
if (strcmp(filename, ".") && strcmp(filename, ".."))
{
if (Util::DirectoryExists(szFullFilename))
{
bOK &= DeleteDirectoryWithContent(szFullFilename);
}
else
{
bOK &= remove(szFullFilename) == 0;
}
}
}
return bOK && RemoveDirectory(szDirFilename);
}
long long Util::FileSize(const char* szFilename)
{
#ifdef WIN32