Add audio_cache_size to set maximum cache size

This commit is contained in:
Henrik Friedrichsen
2021-05-07 23:13:03 +02:00
parent f0d5e31c86
commit 5fd93c33cb
3 changed files with 5 additions and 1 deletions

View File

@@ -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");