Browse Source

Change APP_ARCH global to APP_OS.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
9a635b54e7
3 changed files with 8 additions and 8 deletions
  1. +1
    -1
      include/common.hpp
  2. +3
    -3
      src/common.cpp
  3. +4
    -4
      src/library.cpp

+ 1
- 1
include/common.hpp View File

@@ -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;




+ 3
- 3
src/common.cpp View File

@@ -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";



+ 4
- 4
src/library.cpp View File

@@ -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


Loading…
Cancel
Save