Browse Source

Refresh plugin only if the plugin slug and exact version is not found or

does not match
tags/v0.5.0
Andrew Belt 7 years ago
parent
commit
07412b413c
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      src/plugin.cpp

+ 13
- 2
src/plugin.cpp View File

@@ -226,11 +226,22 @@ static int extractZip(const char *filename, const char *dir) {
static void refreshPurchase(json_t *pluginJ) {
json_t *slugJ = json_object_get(pluginJ, "slug");
if (!slugJ) return;
const char *slug = json_string_value(slugJ);
std::string slug = json_string_value(slugJ);

json_t *nameJ = json_object_get(pluginJ, "name");
if (!nameJ) return;
const char *name = json_string_value(nameJ);
std::string name = json_string_value(nameJ);

json_t *versionJ = json_object_get(pluginJ, "version");
if (!versionJ) return;
std::string version = json_string_value(versionJ);

// Check whether the plugin is already loaded
for (Plugin *plugin : gPlugins) {
if (plugin->slug == slug && plugin->version == version) {
return;
}
}

// Append token and version to download URL
std::string url = gApiHost;


Loading…
Cancel
Save