diff --git a/src/source_package_publishing_history.cpp b/src/source_package_publishing_history.cpp index b71af24..e3ac952 100644 --- a/src/source_package_publishing_history.cpp +++ b/src/source_package_publishing_history.cpp @@ -27,6 +27,7 @@ source_package_publishing_history::source_package_publishing_history() lp(nullptr), distro_series([this]() -> std::optional { if (distro_series_link.empty()) return std::nullopt; + if (_distro_series) return _distro_series; auto response = lp ? lp->api_get(distro_series_link) : std::nullopt; if (!response) return std::nullopt; @@ -36,6 +37,7 @@ source_package_publishing_history::source_package_publishing_history() if (ds) { ds->set_lp(lp); + _distro_series = ds; return ds; } diff --git a/src/source_package_publishing_history.h b/src/source_package_publishing_history.h index 6a1ae9d..9b944ea 100644 --- a/src/source_package_publishing_history.h +++ b/src/source_package_publishing_history.h @@ -57,6 +57,7 @@ public: private: launchpad* lp; + std::optional _distro_series = std::nullopt; }; #endif // SOURCE_PACKAGE_PUBLISHING_HISTORY