mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Make Downloader::repairFile create new XML data on filesize mismatch
This commit is contained in:
parent
8caaf30f16
commit
0230a3517d
@ -1519,12 +1519,32 @@ int Downloader::repairFile(const std::string& url, const std::string& filepath,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bLocalXMLExists)
|
||||
{
|
||||
std::cout << "Deleting old XML data" << std::endl;
|
||||
boost::filesystem::remove(xml_file, ec); // Delete old XML data
|
||||
if (ec)
|
||||
{
|
||||
std::cout << "Failed to delete " << xml_file << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
CURLcode result = this->downloadFile(url, filepath, xml_data, gamename);
|
||||
std::cout << std::endl;
|
||||
if (result == CURLE_OK)
|
||||
{
|
||||
bLocalXMLExists = boost::filesystem::exists(xml_file); // Check to see if downloadFile saved XML data
|
||||
if (!bLocalXMLExists)
|
||||
{
|
||||
std::cout << "Starting automatic XML creation" << std::endl;
|
||||
Util::createXML(filepath, config.iChunkSize, xml_directory);
|
||||
}
|
||||
res = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user