diff options
| author | tslil <tslil@posteo.de> | 2026-07-16 09:01:33 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-07-16 09:09:13 +0100 |
| commit | 4b912fbb21eff1fd8b7178619a402fbd4dacebfd (patch) | |
| tree | eabd15ac1740b6e38a3794aca03ba93b68319de6 | |
| parent | 322271f3d322bc25c30ebe936c7428f1b0df479d (diff) | |
| -rw-r--r-- | Cargo.lock | 2 | ||||
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/cli.rs | 2 | ||||
| -rw-r--r-- | src/state.rs | 15 |
4 files changed, 16 insertions, 5 deletions
@@ -314,7 +314,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "mood" -version = "0.5.0" +version = "0.6.0" dependencies = [ "chrono", "directories", @@ -1,6 +1,6 @@ [package] name = "mood" -version = "0.5.0" +version = "0.6.0" description = "A music player governed by your moods." edition = "2024" license = "GPL-3.0-or-later" @@ -10,7 +10,7 @@ pub enum Action { } const NAME: &str = env!("CARGO_PKG_NAME"); -const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); const DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION"); fn print_help() { diff --git a/src/state.rs b/src/state.rs index 47998f3..aae22b0 100644 --- a/src/state.rs +++ b/src/state.rs @@ -4,7 +4,7 @@ use directories::ProjectDirs; use expanduser::expanduser; use serde::{Deserialize, Serialize}; -use crate::{albums, config::Config, intuition::Intuition, trajectory::Trajectory}; +use crate::{albums, cli::VERSION, config::Config, intuition::Intuition, trajectory::Trajectory}; fn default_state_path() -> String { let name = "mood.json.zstd"; @@ -18,10 +18,21 @@ fn default_state_path() -> String { .unwrap_or(format!("~/.config/mood/{name}")) } -#[derive(Serialize, Deserialize, Default)] +#[derive(Serialize, Deserialize)] pub struct State { trajectory: Trajectory, intuition: Intuition, + version: String, +} + +impl Default for State { + fn default() -> State { + State { + trajectory: Trajectory::default(), + intuition: Intuition::default(), + version: VERSION.to_string(), + } + } } impl State { |
