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
This commit is contained in:
Erica Z 2024-10-18 22:49:42 +02:00
parent 2f99ae9edf
commit f8ad4cd36d

View file

@ -124,6 +124,8 @@ class Playbin : GLib.Object {
} else { } else {
this.play_queue_position = (uint) data.parse_int64 (); this.play_queue_position = (uint) data.parse_int64 ();
debug (@"playlist-pos has been updated to $(this.play_queue_position)"); 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; break;
@ -135,10 +137,6 @@ class Playbin : GLib.Object {
case Mpv.EventId.START_FILE: case Mpv.EventId.START_FILE:
debug ("START_FILE received"); 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; break;
case Mpv.EventId.END_FILE: case Mpv.EventId.END_FILE: