mirror of
https://github.com/nzbget/nzbget.git
synced 2026-04-24 14:56:53 -04:00
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:
36
Util.cpp
36
Util.cpp
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user