avoid parsing config file as a sound

This commit is contained in:
Max Bradbury 2021-04-26 22:00:30 +01:00
parent fa7361d20f
commit 7db845e03e
1 changed files with 8 additions and 1 deletions

View File

@ -156,7 +156,14 @@ fn build_ui(application: &gtk::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");