From e7a7d2c47e97c3e344f0cf981a6af7d4a56201d4 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 9 Apr 2026 23:30:43 +0545 Subject: [PATCH] fix(services): Properly define and emit Seeked signal with correct GObject typing - Removed outdated TODO comment and placeholder signal definition that caused type conversion errors - Added Signal with explicit GObject.TYPE_INT64 argument type and correct parameter extraction using .get_int64() - Ensured reliable emission of seeked signal to upstream DBus handler --- services/mpris.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/services/mpris.py b/services/mpris.py index 338dac8..d15a82f 100644 --- a/services/mpris.py +++ b/services/mpris.py @@ -1,7 +1,7 @@ from typing import Literal, Optional from fabric.core.service import Property, Service, Signal -from fabric.utils import Gio, GLib, logger +from fabric.utils import Gio, GLib, logger, GObject from fabric.utils.helpers import ( bulk_connect, clamp, @@ -27,10 +27,7 @@ class MprisPlayer(Service): @Signal def changed(self) -> None: ... - # TODO: why??? object - # TypeError: can't convert return value to desired type - @Signal - def seeked(self, position: int) -> object: ... + seeked = Signal(name="seeked", arg_types=(GObject.TYPE_INT64,)) @Property(str, "readable") def player_name(self): @@ -256,7 +253,7 @@ class MprisPlayer(Service): ): # Only One Signal for Mpris if signal_name == "Seeked": - self.seeked(params[0]) + self.seeked(params[0].get_int64()) def _proxy_call(self, method_name: str, parameter: Optional[GLib.Variant]): self._dbus_helper.proxy.call(