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:
John M. Merchant
2021-10-15 11:43:00 -04:00
committed by GitHub
parent 54e00581a3
commit 25505be540

View File

@@ -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));
}
}