mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-05 02:39:53 +02:00
Merge pull request #506 from LaurentLouf/feature-split_cache_folders
Feature split cache folders, resolves #505
This commit is contained in:
commit
414383db18
2 changed files with 32 additions and 12 deletions
18
src/main.rs
18
src/main.rs
|
@ -97,6 +97,11 @@ fn setup(args: &[String]) -> Setup {
|
|||
"cache",
|
||||
"Path to a directory where files will be cached.",
|
||||
"CACHE",
|
||||
).optopt(
|
||||
"",
|
||||
"system-cache",
|
||||
"Path to a directory where system files (credentials, volume) will be cached. Can be different from cache option value",
|
||||
"SYTEMCACHE",
|
||||
).optflag("", "disable-audio-cache", "Disable caching of the audio data.")
|
||||
.reqopt("n", "name", "Device name", "NAME")
|
||||
.optopt("", "device-type", "Displayed device type", "DEVICE_TYPE")
|
||||
|
@ -251,9 +256,16 @@ fn setup(args: &[String]) -> Setup {
|
|||
|
||||
let use_audio_cache = !matches.opt_present("disable-audio-cache");
|
||||
|
||||
let cache = matches
|
||||
.opt_str("c")
|
||||
.map(|cache_location| Cache::new(PathBuf::from(cache_location), use_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()));
|
||||
|
||||
let cache = Some(Cache::new(
|
||||
PathBuf::from(cache_directory),
|
||||
PathBuf::from(system_cache_directory),
|
||||
use_audio_cache,
|
||||
));
|
||||
|
||||
let initial_volume = matches
|
||||
.opt_str("initial-volume")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue