diff --git a/src/ui/play_queue/song.rs b/src/ui/play_queue/song.rs index 91fbd33..ad1e9a5 100644 --- a/src/ui/play_queue/song.rs +++ b/src/ui/play_queue/song.rs @@ -60,13 +60,10 @@ mod imp { #[weak(rename_to = self_)] self, move |_, _, _| { - /* self_ .obj() .window() - .playbin() - .remove_entry(self_.obj().displayed_position() as usize - 1)*/ - todo!() + .playlist_remove(self_.obj().position() as i64) } )) .build(); diff --git a/src/ui/window.rs b/src/ui/window.rs index 1670bc8..a037363 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -396,4 +396,12 @@ impl Window { .command(["playlist-play-index", &index.to_string()]) .unwrap(); } + + pub fn playlist_remove(&self, index: i64) { + self.imp() + .mpv + .command(["playlist-remove", &index.to_string()]) + .unwrap(); + self.playlist_model().remove(index as u32); + } }