Skip to content

Commit

Permalink
include cache_folder when initializing the application state
Browse files Browse the repository at this point in the history
  • Loading branch information
aome510 committed Jul 19, 2023
1 parent fd4b5fd commit 56f57b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions spotify_player/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ fn main() -> Result<()> {
// initialize the application state
let state = std::sync::Arc::new(state::State::new(
&config_folder,
&cache_folder,
args.get_one::<String>("theme"),
)?);

Expand Down
4 changes: 2 additions & 2 deletions spotify_player/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ pub struct State {

impl State {
/// creates an application's state based on files in a configuration folder and an optional pre-defined theme
pub fn new(config_folder: &std::path::Path, theme: Option<&String>) -> Result<Self> {
pub fn new(config_folder: &std::path::Path, cache_folder: &std::path::Path, theme: Option<&String>) -> Result<Self> {
let state = Self {
app_config: config::AppConfig::new(config_folder, theme)?,
keymap_config: config::KeymapConfig::new(config_folder)?,
theme_config: config::ThemeConfig::new(config_folder)?,
cache_folder: std::path::PathBuf::new(),
cache_folder: cache_folder.to_path_buf(),
ui: Mutex::new(UIState::default()),
player: RwLock::new(PlayerState::default()),
data: RwLock::new(AppData::default()),
Expand Down

0 comments on commit 56f57b3

Please sign in to comment.