sort contents in filetree

This commit is contained in:
krolxon 2024-05-22 19:28:10 +05:30
parent 6a9e3d9801
commit c3dc9931d5
1 changed files with 4 additions and 4 deletions

View File

@ -62,10 +62,12 @@ impl FileBrowser {
}
}
// Add metadata
dir_vec.sort_by(|a, b| a.0.cmp(&b.0));
file_vec.sort_by(|a, b| a.0.cmp(&b.0));
dir_vec.extend(file_vec);
self.filetree = dir_vec;
// Add metadata
self.songs.clear();
for (t, song) in self.filetree.iter() {
if t == "file" {
@ -128,8 +130,6 @@ impl FileBrowser {
}
}
impl Default for FileBrowser {
fn default() -> Self {
Self::new()