From 2783596f3d6ea8016735bb3ebbea7db72dfdf117 Mon Sep 17 00:00:00 2001 From: DaPigGuy Date: Mon, 5 Aug 2024 02:46:48 -0700 Subject: [PATCH] chore: remove `_on_player_model_changed` This function was originally from GNOME Music, where it serves as the handler for a signal. Here in muzika, the sole caller is `_on_current_song_changed`, and none of the arguments passed are actually relevant, so move the important bits into `_on_current_song_changed` directly. --- src/mpris.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/mpris.ts b/src/mpris.ts index 893a0588..10c70d12 100644 --- a/src/mpris.ts +++ b/src/mpris.ts @@ -379,25 +379,9 @@ export class MPRIS extends DBusInterface { return [false, ["/", "", ""]]; } - private _on_current_song_changed() { - // IDK - this._on_player_model_changed(this.player.queue.list, 0, 0, 0); - } - previous_state = new Map(); - _on_player_model_changed( - model: Gio.ListStore, - _pos: number, - _removed: number, - added: number, - ) { - // Don't update the properties if the model has completely changed. - // These changes will be applied once a new song starts playing. - if (added == model.n_items) { - return; - } - + private _on_current_song_changed() { const properties: Record = { Metadata: GLib.Variant.new("a{sv}", this._get_metadata()), };