If multiple threads detected that directory didn't exist at the same time and tried to create it then one thread would succeed in creating it first and other threads would be trying to create a directory that already exists.
boost::filesystem::create_directories() would then return false for those threads and skip the file download.
Having additional check to see if the directory exists after boost::filesystem::create_directories() returns false fixes the problem.
Changed message queue to use the new "Message" class.
Simplifies status message printing by having the message class take care of formatting and keeping track of the message type.
Status messages are now timestamped and colored based on message type
I would like to use LGOGDownloader in conjunction with Gentoo's
package manager, which may execute it as root, portage, or some other
user in the portage group. A shared configuration under /etc will be
used to avoid sandboxing issues. This will not be world readable.
Adds options to set path to CA certificate bundle in PEM format.
CURL_CA_BUNDLE environment variable is used if it is set and CA certificate path is not set with --cacert option.
Some GOG XML data files contain additional nodes/elements that were not handled properly and caused issues.
We only care about the "chunk" elements so lets ignore all other xml elements.
New option "--threads" can be used to set how many parallel downloads to run. The default is 4 threads.
Changes to behavior:
- Serials and changelogs are saved and covers downloaded for all games that match the "--game" filter before any other files are downloaded.
- Automatic XML creation is run after all files are downloaded. Previously xml data was automatically created right after download finished.
- The "--limit-rate" option sets rate limit for thread not global rate limit.
CURLOPT_XFERINFOFUNCTION was introduced in libcurl 7.32.0
Newer libcurl prefers the new callback even if both CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION are set. Therefore we can still support older versions libcurl.
gameFile now contains gamename and file type info
Game details cache format has been changed to match gameFile changes
Cache also has a new "gamedetails-cache-version" field that can be used to detect cache format changes
Save game details json for later use when DLC info is downloaded in Downloader::getGames.
This reduces the amount of HTTP requests because we don't need to download the info again in Downloader::getGameDetails.