Use build instead of build_record
This commit is contained in:
parent
2cbe2897a2
commit
b7011711b3
@ -20,6 +20,7 @@
|
||||
#include "archive_permission.h"
|
||||
#include "binary_package_publishing_history.h"
|
||||
#include "archive_dependency.h"
|
||||
#include "build.h"
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@ -244,7 +245,7 @@ std::optional<nlohmann::json> archive::getBuildCounters(bool include_needsbuild)
|
||||
return nlohmann::json::parse(response.value());
|
||||
}
|
||||
|
||||
std::generator<build_record> archive::getBuildRecords(const std::string& build_state,
|
||||
std::generator<build> archive::getBuildRecords(const std::string& build_state,
|
||||
const std::string& pocket,
|
||||
const std::string& source_name) const {
|
||||
std::map<std::string,std::string> params;
|
||||
@ -258,9 +259,10 @@ std::generator<build_record> archive::getBuildRecords(const std::string& build_s
|
||||
while (true) {
|
||||
if (data.contains("entries") && data["entries"].is_array()) {
|
||||
for (auto& e : data["entries"]) {
|
||||
build_record br;
|
||||
br.data = e;
|
||||
co_yield br;
|
||||
auto b_opt = build::parse(e.dump());
|
||||
if(!b_opt) continue;
|
||||
b_opt->set_lp(lp);
|
||||
co_yield b_opt.value();
|
||||
}
|
||||
}
|
||||
if(!data.contains("next_collection_link") || data["next_collection_link"].is_null() || data["next_collection_link"]=="") break;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "archive_permission.h"
|
||||
#include "binary_package_publishing_history.h"
|
||||
#include "archive_dependency.h"
|
||||
#include "build.h"
|
||||
#include <generator>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <optional>
|
||||
@ -36,10 +37,6 @@
|
||||
|
||||
class launchpad;
|
||||
|
||||
struct build_record {
|
||||
nlohmann::json data;
|
||||
};
|
||||
|
||||
class archive {
|
||||
public:
|
||||
archive();
|
||||
@ -102,7 +99,7 @@ public:
|
||||
bool strict_component = false) const;
|
||||
std::optional<archive_dependency> getArchiveDependency(const std::string& dependency_link) const;
|
||||
std::optional<nlohmann::json> getBuildCounters(bool include_needsbuild = false) const;
|
||||
std::generator<build_record> getBuildRecords(const std::string& build_state = "",
|
||||
std::generator<build> getBuildRecords(const std::string& build_state = "",
|
||||
const std::string& pocket = "",
|
||||
const std::string& source_name = "") const;
|
||||
std::optional<nlohmann::json> getBuildSummariesForSourceIds(const std::vector<std::string>& source_ids) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user