From b34032690b4cdcf23e409146abe0df17048914a9 Mon Sep 17 00:00:00 2001 From: Laurent Louf Date: Sun, 2 Aug 2020 10:52:09 +0200 Subject: [PATCH] Don't create directories for the audio cache if it disabled --- core/src/cache.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/cache.rs b/core/src/cache.rs index b081831..1200c89 100644 --- a/core/src/cache.rs +++ b/core/src/cache.rs @@ -28,8 +28,10 @@ fn mkdir_existing(path: &Path) -> io::Result<()> { impl Cache { pub fn new(audio_location: PathBuf, system_location: PathBuf, use_audio_cache: bool) -> Cache { - mkdir_existing(&audio_location).unwrap(); - mkdir_existing(&audio_location.join("files")).unwrap(); + if use_audio_cache == true { + mkdir_existing(&audio_location).unwrap(); + mkdir_existing(&audio_location.join("files")).unwrap(); + } mkdir_existing(&system_location).unwrap(); Cache {