Add add command for adding song to playlist (#1232)
* Add command for adding song to playlist * edits for code style * Return playlist dialog via `CommandResult::Modal` --------- Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
@@ -272,6 +272,19 @@ impl CommandManager {
|
||||
self.spotify.shutdown();
|
||||
Ok(None)
|
||||
}
|
||||
Command::AddCurrent => {
|
||||
if let Some(track) = self.queue.get_current() {
|
||||
if let Some(track) = track.track() {
|
||||
let dialog = ContextMenu::add_track_dialog(
|
||||
self.library.clone(),
|
||||
self.queue.get_spotify(),
|
||||
track,
|
||||
);
|
||||
s.add_layer(dialog);
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
Command::SaveCurrent => {
|
||||
if let Some(mut track) = self.queue.get_current() {
|
||||
track.save(&self.library);
|
||||
@@ -284,6 +297,7 @@ impl CommandManager {
|
||||
| Command::Play
|
||||
| Command::Save
|
||||
| Command::SaveQueue
|
||||
| Command::Add
|
||||
| Command::Delete
|
||||
| Command::Focus(_)
|
||||
| Command::Back
|
||||
|
||||
Reference in New Issue
Block a user