55 Commits

Author SHA1 Message Date
Andrey Prygunkov
adf3e05e1d #351: refactor: utility function "Sleep"
to replace direct calls to “usleep”, with parameter in milliseconds
instead of microseconds.
2019-01-22 22:23:40 +01:00
Andrey Prygunkov
e3bd94189a #351: refactor: moved changeable state into new Unit "WorkState.cpp"
from Unit “Options.cpp”. The latter now contains only program options
(which cannot be changed without reload).
2019-01-22 21:57:00 +01:00
Andrey Prygunkov
92828acab0 #351: reworked timed services
Now sleeping much longer, up to next scheduled work, instead of often
wake ups to check if the work needs to be performed. This improves CPU
usage in idle.
2019-01-21 21:21:16 +01:00
Andrey Prygunkov
5a0eae7bf4 #541: fixed log messages printed twice 2018-08-25 17:54:28 +02:00
Andrey Prygunkov
5e15677218 #541: better duplicate handling of urls 2018-07-12 21:19:09 +02:00
Andrey Prygunkov
14c5a1caf7 #541: delayed fetching of nzbs added via urls 2018-07-07 18:16:40 +02:00
Andrey Prygunkov
b7102894d7 #498: fixed pp-parameter initialization 2018-01-25 23:47:53 +01:00
Andrey Prygunkov
085c612f97 #24: fixed errors when adding many files at once 2017-04-25 21:36:53 +02:00
Andrey Prygunkov
9a92896678 #319: unified extension scripts settings
- new option “Extension” as replacement for options “PostScript”,
“QueueScript”, “ScanScript”, “FeedScript”;
- renamed “CategoryX.PostScript” to “CategoryX.Extensions”;
- renamed “FeedX.PostScript” to “FeedX.Extensions”.
2016-12-14 20:34:14 +01:00
Andrey Prygunkov
a59b29c731 #210: auto adjusting file names with reserved words
… by prepending an underscore; with special support in par2-module.
2016-04-26 23:24:40 +02:00
Andrey Prygunkov
5948729b87 #185: guarded containers
Using guarded lists to automatically unlock containers.
2016-03-18 21:45:29 +01:00
Andrey Prygunkov
f973388879 #185: use guards with private mutexes
Use guard objects to automatically unlock private mutexes when leaving
current scope.
2016-03-16 22:37:19 +01:00
Andrey Prygunkov
1a74695126 #148: unique smart pointers for download containers 2016-03-11 22:49:14 +01:00
Andrey Prygunkov
f3f7fbd0de #176: updated copyright notice in source files
- added link to http://nzbget.net;
- replaced FSF Post address with a web link;
- removed unusable subversion-tags;
- updated year.
2016-03-01 19:45:07 +01:00
Andrey Prygunkov
bfa5027bf9 #175: in-class member initializers 2016-02-28 19:53:37 +01:00
Andrey Prygunkov
1162c89e77 #167: prefer stack objects 2016-02-17 22:02:41 +01:00
Andrey Prygunkov
ff69fbbeb9 #136: avoid double slashes in paths
Extra long path names are not normalized automatically by Windows and
therefore must contain paths in canonical form.
2016-01-23 14:23:53 +01:00
Andrey Prygunkov
080bd22d77 #141: ignore hidden files and directories in NzbDir
The files and directories whose names start with dot are now ignored by
the scanner of incoming nzb directory.
2016-01-17 12:58:43 +01:00
Andrey Prygunkov
17024eb0e5 #126: replaced "char*" with "CString" at few more places 2016-01-16 16:31:45 +01:00
Andrey Prygunkov
0ee644d252 #154: use lambdas when deleting elements from containers 2016-01-14 19:42:49 +01:00
Andrey Prygunkov
ef4a72d383 #152: eliminated dereferences in for-range loops using “begin()” and “end()” template functions in “nzbget.h” 2016-01-13 19:44:40 +01:00
Andrey Prygunkov
b32b4c0691 #152: for-range loops with iterators 2016-01-12 00:30:17 +01:00
Andrey Prygunkov
09dde2b82f #143: store Scanner objects directly in container 2016-01-07 00:07:06 +01:00
Andrey Prygunkov
f6587d3299 #143: store Script objects and templates directly in container 2016-01-05 23:47:59 +01:00
Andrey Prygunkov
3e89638b39 refactor: replaced "time(NULL)" with an utility function 2016-01-01 14:57:48 +01:00
Andrey Prygunkov
04c3e0d263 #138: use "nullptr" instead of "NULL" 2015-12-30 16:35:07 +01:00
Andrey Prygunkov
e11dfb62d0 #136: Unicode-Windows-API for file operations
- internally all paths are handled in UTF8;
- all paths are stored in config-file in UTF8;
- when calling file access Windows API functions the paths are
converted to wide-chars and Unicode-API is used;
- extra long paths are prefixed with “\\?\” (extended path format).
2015-12-28 10:56:11 +01:00
Andrey Prygunkov
eae6fd5d91 #131: wrapped function "remove" into module FileSystem
under name “DeleteFile”.
2015-12-24 18:34:15 +01:00
Andrey Prygunkov
321c7efa41 #130: moved parts from module "Util" into new module "FileSystem" 2015-12-22 22:01:03 +01:00
Andrey Prygunkov
19ce3bf69b #130: improved class DirBrowser
It doesn’t return filenames ‘.’ and ‘..’ (for current and parent
directories) anymore, eliminating the need to check and ignore these
names on each usage of the class.
2015-12-21 20:54:21 +01:00
Andrey Prygunkov
99d8cee0db #126: class BString supports initialization via assignment
which makes the code clearer.
2015-12-20 23:46:22 +01:00
Andrey Prygunkov
d87d6ac2ac #126: using CString for ref-parameters and return values
1) for parameters use references to CString instead of pointers to
buffers;
2) when returning strings use CString instead of pointer to char buffer
which caller needs to deallocate;
3) use BString even more.
2015-12-20 16:27:01 +01:00
Andrey Prygunkov
9e2d8544da #126: full use of class BString
1) replaced characters arrays with class BString through the whole
program. The string formatting code has become much cleaner.
2) class Util returns error message via CString instead of character
buffers.
3) few more places to use CString.
2015-12-19 18:43:52 +01:00
Andrey Prygunkov
558fce9b47 #126: replaced C-style strings with class "CString"
: replaced all data members.
2015-12-12 16:36:25 +01:00
Andrey Prygunkov
4e4816c3c8 #116: use size specific integer types 2015-11-21 00:02:22 +01:00
Andrey Prygunkov
ec17d119a1 #115: put all external headers together
into “nzbget.h”
2015-11-19 23:51:02 +01:00
Andrey Prygunkov
70ccfd9802 normalized whitespace formatting
1) removed trailing spaces and tabs;
2) replaced occasional leading spaces with tabs.
2015-11-05 23:45:19 +01:00
Andrey Prygunkov
bf49f16d7c #103: renamed global variables 2015-11-01 21:42:35 +01:00
Andrey Prygunkov
1fb21b330e #103: normalized (renamed) acronyms 2015-10-30 23:54:37 +01:00
Andrey Prygunkov
5adb50274e #103: renamed local, member variables and function parameters 2015-10-27 22:37:23 +01:00
Andrey Prygunkov
6c3f2a9871 #21: refactor: new modules Service and DiskService
Extracted secondary functions from module PrePostProcessor into new
modules Service and DiskService.
2015-08-03 23:27:02 +02:00
Andrey Prygunkov
659ed48652 #26: ignored nzbs are now added to history
When an nzb-file isn’t added to queue for some reason, the file is now
also added to history (in addition to messages printed to log):
- for malformed nzb-files which cannot be parsed the status in history
“DELETE: SCAN”;
- for duplicate files with exactly same content status “DELETE: COPY”;
- for duplicate files having history items with status “GOOD” - status
“DELETE: GOOD”;
- for duplicate files having history items with status “SUCCESS” -
status “DELETE: SUCCESS”;
- history items have log-entries with explanation;
- new values for field “DeleteStatus” of RPC-Method “history”: GOOD,
SUCCESS, COPY, SCAN;
- new values for field “Status” of RPC-Method “history”:
"FAILURE/SCAN”, ”DELETED/COPY”, "DELETED/GOOD”, "DELETED/SUCCESS”;
- one exception: for files added from RSS-feeds no history items are
created, the files are ignored as if they were filtered.
2015-07-23 23:47:59 +02:00
Andrey Prygunkov
5d24697b0c refactor: reworked declaration of global objects (singletones) 2015-05-22 20:28:05 +00:00
Andrey Prygunkov
934c9e23ba refactor: new directory "extension" to hold all extension script related modules 2015-05-21 18:42:33 +00:00
Andrey Prygunkov
2441cc208f refactor: reducing module dependencies for easier testing: extracted config handling code from module "Options" into new module "ScriptConfig", which can be instantiated separately 2015-05-21 16:10:17 +00:00
Andrey Prygunkov
c5cb95fd8c additional parameters (env. vars) are now passed to scan scripts: NZBNP_DUPEKEY, NZBNP_DUPESCORE, NZBNP_DUPEMODE; scan-scripts can now set dupekey, dupemode and dupescore by printing new special commands 2014-10-16 20:40:09 +00:00
Andrey Prygunkov
6afbade8f7 improved scan-scripts: if the category of nzb-file is changed by the scan-script the assigned post-processing scripts are now automatically reset according to the new category 2014-10-03 20:58:11 +00:00
Andrey Prygunkov
e206d3a833 fixed several compiler warnings 2014-09-27 21:04:06 +00:00
Andrey Prygunkov
f0e60ee577 improvement in RPC-API: method "append" now returns id of added nzb-file or "0" on an error; this makes it easier for third-party apps to track added nzb-files; for backward compatibility with older software expecting a boolean result the old version of method "append" is still supported; the new version of method "append" has a different signature (order of parameters); parameter "content" can now be either nzb-file content (encoded in base 64) or an URL; this makes the method "appendurl" obsolete (still supported for compatibility); if an URL was added to queue the queue entry created for fetched nzb-file has the same "NZBID" for easier tracking 2014-06-19 15:00:46 +00:00
Andrey Prygunkov
5aaaa1e6a7 fixed: the program could crash during cleanup if files with invalid timestamps were found in the directory (windows only) 2014-06-09 20:52:23 +00:00