mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 10:19:27 +02:00
Fix incorrect cache initialisation causing crash on startup
This commit is contained in:
parent
b76543b9a7
commit
efabb03631
1 changed files with 11 additions and 11 deletions
22
src/main.rs
22
src/main.rs
|
@ -254,18 +254,18 @@ fn setup(args: &[String]) -> Setup {
|
||||||
mapped_volume: !matches.opt_present("mixer-linear-volume"),
|
mapped_volume: !matches.opt_present("mixer-linear-volume"),
|
||||||
};
|
};
|
||||||
|
|
||||||
let use_audio_cache = !matches.opt_present("disable-audio-cache");
|
let cache = matches.opt_str("c").map(|cache_path| {
|
||||||
|
let use_audio_cache = !matches.opt_present("disable-audio-cache");
|
||||||
|
let system_cache_directory = matches
|
||||||
|
.opt_str("system-cache")
|
||||||
|
.unwrap_or(String::from(cache_path.clone()));
|
||||||
|
|
||||||
let cache_directory = matches.opt_str("c").unwrap_or(String::from(""));
|
Cache::new(
|
||||||
let system_cache_directory = matches
|
PathBuf::from(cache_path),
|
||||||
.opt_str("system-cache")
|
PathBuf::from(system_cache_directory),
|
||||||
.unwrap_or(String::from(cache_directory.clone()));
|
use_audio_cache,
|
||||||
|
)
|
||||||
let cache = Some(Cache::new(
|
});
|
||||||
PathBuf::from(cache_directory),
|
|
||||||
PathBuf::from(system_cache_directory),
|
|
||||||
use_audio_cache,
|
|
||||||
));
|
|
||||||
|
|
||||||
let initial_volume = matches
|
let initial_volume = matches
|
||||||
.opt_str("initial-volume")
|
.opt_str("initial-volume")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue