rebind + change playlist update command to update entire library

This commit is contained in:
Henrik Friedrichsen
2019-11-30 17:13:41 +01:00
parent 3a3fe400d3
commit 85e9e99d87
5 changed files with 80 additions and 97 deletions

View File

@@ -2,11 +2,6 @@ use queue::RepeatSetting;
use std::collections::HashMap;
use std::iter::FromIterator;
#[derive(Clone, Serialize, Deserialize, Debug)]
pub enum PlaylistCommands {
Update,
}
#[derive(Clone, Serialize, Deserialize, Debug)]
pub enum SeekInterval {
Forward,
@@ -50,13 +45,13 @@ pub enum SeekDirection {
pub enum Command {
Quit,
TogglePlay,
Playlists(PlaylistCommands),
Stop,
Previous,
Next,
Clear,
Queue,
Play,
UpdateLibrary,
Save,
SaveQueue,
Delete,
@@ -121,6 +116,7 @@ pub fn parse(input: &str) -> Option<Command> {
"clear" => Some(Command::Clear),
"queue" => Some(Command::Queue),
"play" => Some(Command::Play),
"update" => Some(Command::UpdateLibrary),
"delete" => Some(Command::Delete),
"back" => Some(Command::Back),
"open" => args
@@ -210,13 +206,6 @@ pub fn parse(input: &str) -> Option<Command> {
.map(|amount| Command::Seek(SeekDirection::Absolute(amount))),
}),
"focus" => args.get(0).map(|target| Command::Focus(target.to_string())),
"playlists" => args
.get(0)
.and_then(|action| match *action {
"update" => Some(PlaylistCommands::Update),
_ => None,
})
.map(Command::Playlists),
"save" => args.get(0).map(|target| match *target {
"queue" => Command::SaveQueue,
_ => Command::Save,