play next (#278)
* add play next feature * fix play_next insertion order * fix play_next call for playable * document play_next shortcut + reformat Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
@@ -338,6 +338,15 @@ impl<I: ListItem + Clone> ViewExt for ListView<I> {
|
||||
|
||||
return Ok(CommandResult::Consumed(None));
|
||||
}
|
||||
Command::PlayNext => {
|
||||
info!("played next");
|
||||
let mut content = self.content.write().unwrap();
|
||||
if let Some(item) = content.get_mut(self.selected) {
|
||||
item.play_next(self.queue.clone());
|
||||
}
|
||||
|
||||
return Ok(CommandResult::Consumed(None));
|
||||
}
|
||||
Command::Queue => {
|
||||
let mut content = self.content.write().unwrap();
|
||||
if let Some(item) = content.get_mut(self.selected) {
|
||||
|
||||
@@ -95,6 +95,9 @@ impl ViewExt for QueueView {
|
||||
self.queue.play(self.list.get_selected_index(), true, false);
|
||||
return Ok(CommandResult::Consumed(None));
|
||||
}
|
||||
Command::PlayNext => {
|
||||
return Ok(CommandResult::Ignored);
|
||||
}
|
||||
Command::Queue => {
|
||||
return Ok(CommandResult::Ignored);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user