diff --git a/src/playbin.vala b/src/playbin.vala index 4a836f7..81c956c 100644 --- a/src/playbin.vala +++ b/src/playbin.vala @@ -245,7 +245,14 @@ public class Playbin : GLib.Object { public void remove_track (uint position) requires (position < this._play_queue.get_n_items ()) { - assert (false); // TODO + assert (this.mpv.command({"playlist-remove", position.to_string ()}) >= 0); + this._play_queue.remove (position); + if (this.play_queue_position > position) this.play_queue_position -= 1; + if (this.play_queue_position == this._play_queue.get_n_items ()) { + // we just killed the last track + this.state = PlaybinState.STOPPED; + this.stopped (); + } } public void clear () {