modified library.rs to sort after saving an album (#428)
* modified library.rs to sort after saving an album * Reformat Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
@@ -633,6 +633,9 @@ impl Library {
|
||||
let mut store = self.albums.write().unwrap();
|
||||
if !store.iter().any(|a| a.id == album.id) {
|
||||
store.insert(0, album.clone());
|
||||
|
||||
// resort list of albums
|
||||
store.sort_unstable_by_key(|a| format!("{}{}{}", a.artists[0], a.year, a.title));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user