|
|
@ -51,13 +51,12 @@ void source_package_publishing_history::parse_json(const std::string& json_data)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<build> source_package_publishing_history::getBuilds() const {
|
|
|
|
std::generator<build> source_package_publishing_history::getBuilds() const {
|
|
|
|
std::vector<build> builds;
|
|
|
|
if (self_link.empty()) { co_return; }
|
|
|
|
if (self_link.empty()) { return builds; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::map<std::string, std::string> params = {{"ws.op", "getBuilds"}};
|
|
|
|
std::map<std::string, std::string> params = {{"ws.op", "getBuilds"}};
|
|
|
|
auto response = lp->api_get(self_link, params);
|
|
|
|
auto response = lp->api_get(self_link, params);
|
|
|
|
if (!response.has_value()) { return builds; }
|
|
|
|
if (!response.has_value()) { co_return; }
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
auto data = nlohmann::json::parse(response.value());
|
|
|
|
auto data = nlohmann::json::parse(response.value());
|
|
|
@ -66,14 +65,12 @@ std::vector<build> source_package_publishing_history::getBuilds() const {
|
|
|
|
auto b_opt = build::parse(entry.dump());
|
|
|
|
auto b_opt = build::parse(entry.dump());
|
|
|
|
if(!b_opt.has_value()) continue;
|
|
|
|
if(!b_opt.has_value()) continue;
|
|
|
|
b_opt->set_lp(lp);
|
|
|
|
b_opt->set_lp(lp);
|
|
|
|
builds.push_back(b_opt.value());
|
|
|
|
co_yield b_opt.value();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (const std::exception& e) {
|
|
|
|
} catch (const std::exception& e) {
|
|
|
|
std::cerr << "Error parsing builds: " << e.what() << std::endl;
|
|
|
|
std::cerr << "Error parsing builds: " << e.what() << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return builds;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void source_package_publishing_history::set_lp(launchpad* lp_ptr) {
|
|
|
|
void source_package_publishing_history::set_lp(launchpad* lp_ptr) {
|
|
|
|