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_)]
self,
move |_, _, _| {
/*
self_
.obj()
.window()
.playbin()
.remove_entry(self_.obj().displayed_position() as usize - 1)*/
todo!()
.playlist_remove(self_.obj().position() as i64)
}
))
.build();

View file

@ -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);
}
}