Implement (un)saving tracks, albums; (un)following artists

This commit is contained in:
KoffeinFlummi
2019-04-18 15:43:51 +02:00
parent 4c974a83f7
commit 1e58ca9345
9 changed files with 241 additions and 17 deletions

View File

@@ -169,4 +169,12 @@ impl ListItem for Track {
fn queue(&mut self, queue: Arc<Queue>) {
queue.append(self);
}
fn toggle_saved(&mut self, library: Arc<Library>) {
if library.is_saved_track(self) {
library.unsave_tracks(vec![self], true);
} else {
library.save_tracks(vec![self], true);
}
}
}