|
|
|
@ -14,6 +14,7 @@
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
#include "distribution.h"
|
|
|
|
|
#include "distro_series.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
|
|
|
|
|
@ -25,15 +26,15 @@ distribution::distribution()
|
|
|
|
|
summary(""),
|
|
|
|
|
domain_name(""),
|
|
|
|
|
lp(nullptr),
|
|
|
|
|
current_series([this]() -> std::optional<distro_series> {
|
|
|
|
|
if (current_series_link.empty()) return std::nullopt;
|
|
|
|
|
current_series([this]() -> std::optional<::distro_series> {
|
|
|
|
|
if (!lp || current_series_link.empty()) return std::nullopt;
|
|
|
|
|
if (_current_series) return _current_series;
|
|
|
|
|
|
|
|
|
|
auto response = lp ? lp->api_get(current_series_link) : std::nullopt;
|
|
|
|
|
if (!response) return std::nullopt;
|
|
|
|
|
|
|
|
|
|
auto data = nlohmann::json::parse(response.value());
|
|
|
|
|
auto ds = distro_series::parse(data.dump());
|
|
|
|
|
auto ds = ::distro_series::parse(data.dump());
|
|
|
|
|
|
|
|
|
|
if (ds) {
|
|
|
|
|
ds->set_lp(lp);
|
|
|
|
|