sort contents in filetree
This commit is contained in:
parent
6a9e3d9801
commit
c3dc9931d5
|
|
@ -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()
|
||||
|
|
|
|||
Reference in New Issue