From 7db845e03ebb3703f68c0b541f1ce28de391e531 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Mon, 26 Apr 2021 22:00:30 +0100 Subject: [PATCH] avoid parsing config file as a sound --- src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 83c17ca..b185dad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -156,7 +156,14 @@ fn build_ui(application: >k::Application) { paths.sort(); for path in paths { - let name: &str = path.file_stem().unwrap().to_str().unwrap(); + let name = path.file_stem().unwrap().to_str().unwrap(); + let extension = path.extension().unwrap().to_str().unwrap(); + + // on Windows the data dir and config dir are the same, + // so avoid parsing the config file as an audio file + if extension == "toml" { + continue; + } let file = File::open(&path) .expect("Couldn't open audio file");