feat: create new empty playlist via command (#272)

* feat: create new empty playlist via command

- type :newplaylist <name> to create a new playlist

fixes #242

* use full argument string for playlist name

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
Bolli
2020-10-25 17:57:49 +01:00
committed by GitHub
parent 5fb4eb7af2
commit d88ea93a94
3 changed files with 17 additions and 0 deletions

View File

@@ -184,6 +184,13 @@ impl CommandManager {
self.register_keybindings(s);
Ok(None)
}
Command::NewPlaylist(name) => {
match self.spotify.create_playlist(name, None, None) {
Some(_) => self.library.update_library(),
None => error!("could not create playlist {}", name),
}
Ok(None)
}
Command::Search(_)
| Command::Jump(_)
| Command::Move(_, _)