playlist remove

This commit is contained in:
Erica Z 2024-11-04 12:37:46 +01:00
parent 40612729a1
commit f2f6c67383
2 changed files with 9 additions and 4 deletions

View file

@ -60,13 +60,10 @@ mod imp {
#[weak(rename_to = self_)] #[weak(rename_to = self_)]
self, self,
move |_, _, _| { move |_, _, _| {
/*
self_ self_
.obj() .obj()
.window() .window()
.playbin() .playlist_remove(self_.obj().position() as i64)
.remove_entry(self_.obj().displayed_position() as usize - 1)*/
todo!()
} }
)) ))
.build(); .build();

View file

@ -396,4 +396,12 @@ impl Window {
.command(["playlist-play-index", &index.to_string()]) .command(["playlist-play-index", &index.to_string()])
.unwrap(); .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);
}
} }