Fixed a bug where browser entries were not sorted

This commit is contained in:
Antoine Gersant 2024-08-09 16:28:30 -07:00
parent a2232aa9f2
commit 310e3b6c4d

View file

@ -52,7 +52,7 @@ impl Browser {
return Err(Error::DirectoryNotFound(virtual_path.as_ref().to_owned()));
};
Ok(files
let mut files = files
.iter()
.map(|f| {
let path = match f {
@ -65,7 +65,11 @@ impl Browser {
storage::File::Song(_) => File::Song(path),
}
})
.collect())
.collect::<Vec<_>>();
files.sort();
Ok(files)
}
pub fn flatten<P: AsRef<Path>>(