| 537 | m_themesThread = new std::thread(searchThemes, query, page, sort, owner, onFetch); |
| 538 | } |
| 539 | void WebAPI::DownloadTheme(const std::string& id) |
| 540 | { |
| 541 | Logger::Get().Log("Downloading a theme with WebAPI"); |
| 542 | |
| 543 | std::string outputPath = Settings::Instance().ConvertPath("themes/"); |
| 544 | |
| 545 | httplib::Client cli(WebAPI::URL.c_str()); |
| 546 | auto response = cli.Get(("/download?type=theme&id=" + id).c_str()); |
| 547 | |
| 548 | if (response && response->status == 200) { |
| 549 | std::ofstream outFile(outputPath + id + ".ini"); |
| 550 | outFile << response->body; |
| 551 | outFile.close(); |
| 552 | } |
| 553 | } |
| 554 | int WebAPI::GetPluginVersion(const std::string& id) |
| 555 | { |
| 556 | httplib::Client cli(WebAPI::URL.c_str()); |