|
|
|
@ -14,6 +14,7 @@
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
#include "build.h"
|
|
|
|
|
#include "source_package_publishing_history.h"
|
|
|
|
|
#include "utils.h"
|
|
|
|
|
#include "launchpad.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
@ -110,3 +111,15 @@ bool build::rescore(int score) {
|
|
|
|
|
void build::set_lp(launchpad* lp_ptr) {
|
|
|
|
|
lp = lp_ptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const std::optional<source_package_publishing_history> build::getCurrentSourcePublication() {
|
|
|
|
|
auto response = lp->api_get(current_source_publication_link);
|
|
|
|
|
if (!response) return std::nullopt;
|
|
|
|
|
auto data = nlohmann::json::parse(response.value());
|
|
|
|
|
auto sp = source_package_publishing_history::parse(data.dump());
|
|
|
|
|
if (sp) {
|
|
|
|
|
sp->set_lp(lp);
|
|
|
|
|
return sp.value();
|
|
|
|
|
}
|
|
|
|
|
return std::nullopt;
|
|
|
|
|
}
|
|
|
|
|