MCPcopy Create free account
hub / github.com/dfranx/SHADERed / DownloadTheme

Method DownloadTheme

src/SHADERed/Objects/WebAPI.cpp:539–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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());

Callers 1

UpdateMethod · 0.80

Calls 5

InstanceClass · 0.85
LogMethod · 0.80
ConvertPathMethod · 0.80
GetMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected