Add audio_cache_size to set maximum cache size
This commit is contained in:
@@ -21,6 +21,7 @@ pub struct ConfigValues {
|
||||
pub theme: Option<ConfigTheme>,
|
||||
pub use_nerdfont: Option<bool>,
|
||||
pub audio_cache: Option<bool>,
|
||||
pub audio_cache_size: Option<u32>,
|
||||
pub backend: Option<String>,
|
||||
pub backend_device: Option<String>,
|
||||
pub volnorm: Option<bool>,
|
||||
|
||||
@@ -162,7 +162,9 @@ impl Spotify {
|
||||
let cache = Cache::new(
|
||||
Some(config::cache_path("librespot")),
|
||||
audio_cache_path,
|
||||
None,
|
||||
cfg.values()
|
||||
.audio_cache_size
|
||||
.map(|size| (size * 1048576) as u64),
|
||||
)
|
||||
.expect("Could not create cache");
|
||||
debug!("opening spotify session");
|
||||
|
||||
Reference in New Issue
Block a user