@@ -92,8 +92,6 @@ static int loadPlugin(std::string slug) { | |||||
} | } | ||||
void pluginInit() { | void pluginInit() { | ||||
// Load core | // Load core | ||||
// This function is defined in core.cpp | // This function is defined in core.cpp | ||||
Plugin *corePlugin = init(); | Plugin *corePlugin = init(); | ||||
@@ -242,6 +240,7 @@ static void pluginRefreshPlugin(json_t *pluginJ) { | |||||
// Download zip | // Download zip | ||||
std::string filename = "plugins/"; | std::string filename = "plugins/"; | ||||
mkdir(filename.c_str(), 0755); | |||||
filename += slug; | filename += slug; | ||||
filename += ".zip"; | filename += ".zip"; | ||||
bool success = requestDownload(download, filename, &downloadProgress); | bool success = requestDownload(download, filename, &downloadProgress); | ||||
@@ -103,11 +103,6 @@ json_t *requestJson(RequestMethod method, std::string url, json_t *dataJ) { | |||||
} | } | ||||
static size_t writeFileCallback(char *ptr, size_t size, size_t nmemb, void *userdata) { | |||||
FILE *file = (FILE*) userdata; | |||||
return fwrite(ptr, size, nmemb, file); | |||||
} | |||||
static int xferInfoCallback(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) { | static int xferInfoCallback(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) { | ||||
float *progress = (float*) clientp; | float *progress = (float*) clientp; | ||||
if (progress) { | if (progress) { | ||||