From 9a635b54e77f5ffd46398302985e5171768b948b Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 30 Oct 2021 03:38:46 -0400 Subject: [PATCH] Change APP_ARCH global to APP_OS. --- include/common.hpp | 2 +- src/common.cpp | 6 +++--- src/library.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/common.hpp b/include/common.hpp index 40fbab93..ddd8d968 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -266,7 +266,7 @@ extern const std::string APP_EDITION; extern const std::string APP_EDITION_NAME; extern const std::string APP_VERSION_MAJOR; extern const std::string APP_VERSION; -extern const std::string APP_ARCH; +extern const std::string APP_OS; extern const std::string API_URL; diff --git a/src/common.cpp b/src/common.cpp index 62870fbb..5e8d4434 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -21,11 +21,11 @@ const std::string APP_EDITION_NAME = "Community Edition"; const std::string APP_VERSION_MAJOR = "2"; const std::string APP_VERSION = TOSTRING(_APP_VERSION); #if defined ARCH_WIN - const std::string APP_ARCH = "win"; + const std::string APP_OS = "win"; #elif ARCH_MAC - const std::string APP_ARCH = "mac"; + const std::string APP_OS = "mac"; #elif defined ARCH_LIN - const std::string APP_ARCH = "lin"; + const std::string APP_OS = "lin"; #endif const std::string API_URL = "https://api.vcvrack.com"; diff --git a/src/library.cpp b/src/library.cpp index 0f1ab600..117fd738 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -72,7 +72,7 @@ void checkAppUpdate() { json_t* downloadUrlsJ = json_object_get(resJ, "downloadUrls"); if (downloadUrlsJ) { - json_t* downloadUrlJ = json_object_get(downloadUrlsJ, APP_ARCH.c_str()); + json_t* downloadUrlJ = json_object_get(downloadUrlsJ, APP_OS.c_str()); if (downloadUrlJ) appDownloadUrl = json_string_value(downloadUrlJ); } @@ -338,16 +338,16 @@ void syncUpdate(std::string slug) { updateProgress = 0.f; DEFER({updateProgress = 0.f;}); - INFO("Downloading plugin %s v%s for %s", slug.c_str(), update.version.c_str(), APP_ARCH.c_str()); + INFO("Downloading plugin %s v%s for %s", slug.c_str(), update.version.c_str(), APP_OS.c_str()); // Get download URL std::string downloadUrl = API_URL + "/download"; downloadUrl += "?slug=" + network::encodeUrl(slug); downloadUrl += "&version=" + network::encodeUrl(update.version); - downloadUrl += "&arch=" + network::encodeUrl(APP_ARCH); + downloadUrl += "&os=" + network::encodeUrl(APP_OS); // Get file path - std::string packageFilename = slug + "-" + update.version + "-" + APP_ARCH + ".vcvplugin"; + std::string packageFilename = slug + "-" + update.version + "-" + APP_OS + ".vcvplugin"; std::string packagePath = system::join(plugin::pluginsPath, packageFilename); // Download plugin package