diff --git a/include/downloader.h b/include/downloader.h index 9e9d477..f872a3a 100644 --- a/include/downloader.h +++ b/include/downloader.h @@ -77,6 +77,7 @@ typedef struct off_t end_offset; uint16_t file_attributes; uint32_t crc32; + time_t timestamp; std::string installer_url; } zipFileEntry; diff --git a/src/downloader.cpp b/src/downloader.cpp index 0ac1f59..9b2c2f4 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -4320,12 +4320,18 @@ void Downloader::processGalaxyDownloadQueue_MojoSetupHack(Config conf, const uns continue; } - // Set file parmission - boost::filesystem::perms permissions = ZipUtil::getBoostFilePermission(zfe.file_attributes); if (boost::filesystem::exists(path)) + { + // Set file permission + boost::filesystem::perms permissions = ZipUtil::getBoostFilePermission(zfe.file_attributes); Util::setFilePermissions(path, permissions); + + // Set timestamp + if (zfe.timestamp > 0) + boost::filesystem::last_write_time(path, zfe.timestamp); + } } - else // Use temorary file for bigger files + else // Use temporary file for bigger files { vDownloadInfo[tid].setFilename(path_tmp.string()); curl_easy_setopt(dlhandle, CURLOPT_WRITEFUNCTION, Downloader::writeData); @@ -4428,7 +4434,7 @@ void Downloader::processGalaxyDownloadQueue_MojoSetupHack(Config conf, const uns } } - // Set file parmission + // Set file permission boost::filesystem::perms permissions = ZipUtil::getBoostFilePermission(zfe.file_attributes); if (boost::filesystem::exists(path)) Util::setFilePermissions(path, permissions); @@ -4662,6 +4668,7 @@ int Downloader::mojoSetupGetFileVector(const gameFile& gf, std::vector> 16; zfe.crc32 = cd.crc32; + zfe.timestamp = cd.timestamp; zfe.installer_url = installer_url; vFiles.push_back(zfe);