mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Galaxy: Set timestamp for downloaded file
This commit is contained in:
parent
dd5714690c
commit
3b733fcb4b
@ -77,6 +77,7 @@ typedef struct
|
|||||||
off_t end_offset;
|
off_t end_offset;
|
||||||
uint16_t file_attributes;
|
uint16_t file_attributes;
|
||||||
uint32_t crc32;
|
uint32_t crc32;
|
||||||
|
time_t timestamp;
|
||||||
|
|
||||||
std::string installer_url;
|
std::string installer_url;
|
||||||
} zipFileEntry;
|
} zipFileEntry;
|
||||||
|
@ -4320,12 +4320,18 @@ void Downloader::processGalaxyDownloadQueue_MojoSetupHack(Config conf, const uns
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set file parmission
|
|
||||||
boost::filesystem::perms permissions = ZipUtil::getBoostFilePermission(zfe.file_attributes);
|
|
||||||
if (boost::filesystem::exists(path))
|
if (boost::filesystem::exists(path))
|
||||||
|
{
|
||||||
|
// Set file permission
|
||||||
|
boost::filesystem::perms permissions = ZipUtil::getBoostFilePermission(zfe.file_attributes);
|
||||||
Util::setFilePermissions(path, permissions);
|
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());
|
vDownloadInfo[tid].setFilename(path_tmp.string());
|
||||||
curl_easy_setopt(dlhandle, CURLOPT_WRITEFUNCTION, Downloader::writeData);
|
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);
|
boost::filesystem::perms permissions = ZipUtil::getBoostFilePermission(zfe.file_attributes);
|
||||||
if (boost::filesystem::exists(path))
|
if (boost::filesystem::exists(path))
|
||||||
Util::setFilePermissions(path, permissions);
|
Util::setFilePermissions(path, permissions);
|
||||||
@ -4662,6 +4668,7 @@ int Downloader::mojoSetupGetFileVector(const gameFile& gf, std::vector<zipFileEn
|
|||||||
zfe.start_offset_mojosetup = zfe.start_offset_zip + mojosetup_zip_offset;
|
zfe.start_offset_mojosetup = zfe.start_offset_zip + mojosetup_zip_offset;
|
||||||
zfe.file_attributes = cd.external_file_attr >> 16;
|
zfe.file_attributes = cd.external_file_attr >> 16;
|
||||||
zfe.crc32 = cd.crc32;
|
zfe.crc32 = cd.crc32;
|
||||||
|
zfe.timestamp = cd.timestamp;
|
||||||
zfe.installer_url = installer_url;
|
zfe.installer_url = installer_url;
|
||||||
|
|
||||||
vFiles.push_back(zfe);
|
vFiles.push_back(zfe);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user