Explorar o código

Don't create directories for the audio cache if it disabled

Laurent Louf %!s(int64=4) %!d(string=hai) anos
pai
achega
b34032690b
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      core/src/cache.rs

+ 4 - 2
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 {