From f8ad4cd36d790190f3903b91e1d19f13f5c887bb Mon Sep 17 00:00:00 2001 From: Erica Z Date: Fri, 18 Oct 2024 22:49:42 +0200 Subject: [PATCH] only send now_playing when playlist-pos is updated these updates are coalesced, so it's possible that by START_FILE the observed event hasn't had the change to update the property --- src/playbin.vala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/playbin.vala b/src/playbin.vala index 0b4819b..f1b87e1 100644 --- a/src/playbin.vala +++ b/src/playbin.vala @@ -124,6 +124,8 @@ class Playbin : GLib.Object { } else { this.play_queue_position = (uint) data.parse_int64 (); debug (@"playlist-pos has been updated to $(this.play_queue_position)"); + this.song = (Subsonic.Song) this.play_queue.get_item (this.play_queue_position); + this.now_playing (); } break; @@ -135,10 +137,6 @@ class Playbin : GLib.Object { case Mpv.EventId.START_FILE: debug ("START_FILE received"); - if (this.play_queue_position < this.play_queue.get_n_items ()) { - this.song = (Subsonic.Song) this.play_queue.get_item (this.play_queue_position); - this.now_playing (); - } break; case Mpv.EventId.END_FILE: