Don't bother saving tracks while album is being added to library
This commit is contained in:
committed by
Henrik Friedrichsen
parent
98e572169b
commit
00b65557a3
@@ -618,8 +618,6 @@ impl Library {
|
||||
}
|
||||
}
|
||||
|
||||
album.load_all_tracks(self.spotify.clone());
|
||||
|
||||
{
|
||||
let mut store = self.albums.write().unwrap();
|
||||
if !store.iter().any(|a| a.id == album.id) {
|
||||
@@ -627,10 +625,6 @@ impl Library {
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(tracks) = album.tracks.as_ref() {
|
||||
self.save_tracks(tracks.iter().collect(), false);
|
||||
}
|
||||
|
||||
self.save_cache(config::cache_path(CACHE_ALBUMS), self.albums.clone());
|
||||
}
|
||||
|
||||
@@ -649,17 +643,11 @@ impl Library {
|
||||
}
|
||||
}
|
||||
|
||||
album.load_all_tracks(self.spotify.clone());
|
||||
|
||||
{
|
||||
let mut store = self.albums.write().unwrap();
|
||||
*store = store.iter().filter(|a| a.id != album.id).cloned().collect();
|
||||
}
|
||||
|
||||
if let Some(tracks) = album.tracks.as_ref() {
|
||||
self.unsave_tracks(tracks.iter().collect(), false);
|
||||
}
|
||||
|
||||
self.save_cache(config::cache_path(CACHE_ALBUMS), self.albums.clone());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user