mirror of
https://git.chinosk6.cn/chinosk/gkms-localify-dmm.git
synced 2026-02-04 17:14:01 +00:00
fixed Use Remote ZIP Resource
fixed typo
This commit is contained in:
@@ -130,13 +130,16 @@ namespace GkmsResourceUpdate {
|
||||
return content;
|
||||
}
|
||||
|
||||
bool unzipFileFromURL(std::string downloadUrl, const std::string& unzipPath) {
|
||||
bool unzipFileFromURL(std::string downloadUrl, const std::string& unzipPath, const std::string& targetDir = "") {
|
||||
std::string tempZipFile = (gakumasLocalPath / "temp_download.zip").string();
|
||||
if (std::filesystem::exists(tempZipFile)) {
|
||||
std::filesystem::remove(tempZipFile);
|
||||
}
|
||||
if (!DownloadFile(downloadUrl, tempZipFile)) {
|
||||
GakumasLocal::Log::Error("Download zip file failed.");
|
||||
return false;
|
||||
}
|
||||
if (!UnzipFile(tempZipFile, unzipPath)) {
|
||||
if (!UnzipFile(tempZipFile, unzipPath, targetDir)) {
|
||||
GakumasLocal::Log::Error("Unzip file failed.");
|
||||
return false;
|
||||
}
|
||||
@@ -214,9 +217,9 @@ namespace GkmsResourceUpdate {
|
||||
}).detach();
|
||||
}
|
||||
|
||||
void checkUpdateFromURL(std::string downloadUrl) {
|
||||
std::thread([&downloadUrl]() {
|
||||
if (unzipFileFromURL(downloadUrl, gakumasLocalPath.string())) {
|
||||
void checkUpdateFromURL(const std::string& downloadUrl) {
|
||||
std::thread([downloadUrl]() {
|
||||
if (unzipFileFromURL(downloadUrl, gakumasLocalPath.string(), "local-files")) {
|
||||
g_reload_all_data();
|
||||
GakumasLocal::Log::Info("Update completed.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user