diff --git a/src/mpris.ts b/src/mpris.ts index cc429bbb..0aa610a3 100644 --- a/src/mpris.ts +++ b/src/mpris.ts @@ -285,18 +285,6 @@ export class MPRIS extends DBusInterface { ); }), - this.player.queue.connect("notify::can-play-previous", () => { - this._properties_changed( - this.MEDIA_PLAYER2_PLAYER_IFACE, - { - CanGoPrevious: GLib.Variant.new_boolean( - this.player.queue.can_play_previous, - ), - }, - [], - ); - }), - this.player.connect("notify::seeking", () => { if (!this.player.seeking) { this._on_seek_finished(this, this.player.timestamp); @@ -396,7 +384,7 @@ export class MPRIS extends DBusInterface { // already started if (this.player.queue.repeat === RepeatMode.ONE) { this._seeked(0); - if (this.player.queue.can_play_previous) { + if (this.player.queue.position > 0) { return; } } @@ -429,12 +417,6 @@ export class MPRIS extends DBusInterface { this.previous_state.set("can_go_next", has_next); } - const has_previous = this.player.queue.can_play_previous; - if (has_previous != this.previous_state.get("can_go_previous")) { - properties.CanGoPrevious = GLib.Variant.new_boolean(has_previous); - this.previous_state.set("can_go_previous", has_next); - } - if (this.previous_state.get("can_play") != true) { properties.CanPause = GLib.Variant.new_boolean(true); properties.CanPlay = GLib.Variant.new_boolean(true); @@ -633,10 +615,7 @@ export class MPRIS extends DBusInterface { MinimumRate: GLib.Variant.new_double(1.0), MaximumRate: GLib.Variant.new_double(1.0), CanGoNext: GLib.Variant.new_boolean(this.player.queue.can_play_next), - CanGoPrevious: GLib.Variant.new( - "b", - this.player.queue.can_play_previous, - ), + CanGoPrevious: GLib.Variant.new_boolean(true), CanPlay: GLib.Variant.new_boolean(can_play), CanPause: GLib.Variant.new_boolean(can_play), CanSeek: GLib.Variant.new_boolean(true), diff --git a/src/player/queue.ts b/src/player/queue.ts index 739a810b..3ab281f4 100644 --- a/src/player/queue.ts +++ b/src/player/queue.ts @@ -129,13 +129,6 @@ export class Queue extends GObject.Object { false, GObject.ParamFlags.READABLE, ), - "can-play-previous": GObject.param_spec_boolean( - "can-play-previous", - "Can play previous", - "Whether the previous song can be played", - false, - GObject.ParamFlags.READABLE, - ), repeat: GObject.param_spec_uint( "repeat", "Repeat", @@ -290,11 +283,6 @@ export class Queue extends GObject.Object { return this.position < this.list.n_items - 1; } - get can_play_previous() { - if (this.repeat === RepeatMode.ALL) return true; - return this.position > 0; - } - private _position = -1; get position() { @@ -311,7 +299,6 @@ export class Queue extends GObject.Object { this.notify("current"); this.notify("current-is-video"); this.notify("can-play-next"); - this.notify("can-play-previous"); } } @@ -492,7 +479,6 @@ export class Queue extends GObject.Object { name: "previous", parameter_type: null, activate: () => this.previous(), - bind_enabled: [this, "can-play-previous"], }), ); @@ -541,7 +527,6 @@ export class Queue extends GObject.Object { this.repeat = (this.repeat + 1) % 3; this.notify("can-play-next"); - this.notify("can-play-previous"); } private async active_chip_changed_cb() { @@ -556,7 +541,6 @@ export class Queue extends GObject.Object { this.add_tracks("remaining", queue.tracks); - this.notify("can-play-previous"); this.notify("can-play-next"); } }