Fix incorrect cache initialisation causing crash on startup

This commit is contained in:
Sasha Hilton 2021-01-24 23:21:35 +00:00
parent b76543b9a7
commit efabb03631

View file

@ -254,18 +254,18 @@ fn setup(args: &[String]) -> Setup {
mapped_volume: !matches.opt_present("mixer-linear-volume"),
};
let cache = matches.opt_str("c").map(|cache_path| {
let use_audio_cache = !matches.opt_present("disable-audio-cache");
let cache_directory = matches.opt_str("c").unwrap_or(String::from(""));
let system_cache_directory = matches
.opt_str("system-cache")
.unwrap_or(String::from(cache_directory.clone()));
.unwrap_or(String::from(cache_path.clone()));
let cache = Some(Cache::new(
PathBuf::from(cache_directory),
Cache::new(
PathBuf::from(cache_path),
PathBuf::from(system_cache_directory),
use_audio_cache,
));
)
});
let initial_volume = matches
.opt_str("initial-volume")