diff --git a/src/config/config.cpp b/src/config/config.cpp index 325cc8d..81d419f 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -58,7 +58,7 @@ fn NowPlayingImpl::from_class( } //clang-format on -fn NowPlayingImpl::to_class() const -> NowPlaying { return {enabled}; } +fn NowPlayingImpl::to_class() const -> NowPlaying { return {enabled.value_or(false)}; } fn ConfigImpl::from_class(const Config& config) noexcept -> ConfigImpl { return { diff --git a/src/config/config.h b/src/config/config.h index 998838f..d50e16a 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -61,20 +61,20 @@ class Weather { struct WeatherOutput { Clouds clouds; - Main main; - Sys sys; - Wind wind; isize timezone; isize visibility; + Main main; rfl::Rename<"coord", Coords> coords; std::optional rain; std::optional snow; std::string base; std::string name; std::vector weather; + Sys sys; usize cod; usize dt; usize id; + Wind wind; }; using Location = std::variant; @@ -132,7 +132,7 @@ class NowPlaying { }; struct NowPlayingImpl { - bool enabled; + std::optional enabled; static fn from_class(const NowPlaying& now_playing ) noexcept -> NowPlayingImpl;