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
This commit is contained in:
sankalp committed 2026-04-09 23:30:43 +05:45
1 parent cdc82c4c7f
commit e7a7d2c47e
1 file changed
+3 -6
+3 -6
View File
@@ -1,7 +1,7 @@
from typing import Literal, Optional from typing import Literal, Optional
from fabric.core.service import Property, Service, Signal 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 ( from fabric.utils.helpers import (
bulk_connect, bulk_connect,
clamp, clamp,
@@ -27,10 +27,7 @@ class MprisPlayer(Service):
@Signal @Signal
def changed(self) -> None: ... def changed(self) -> None: ...
# TODO: why??? object seeked = Signal(name="seeked", arg_types=(GObject.TYPE_INT64,))
# TypeError: can't convert return value to desired type
@Signal
def seeked(self, position: int) -> object: ...
@Property(str, "readable") @Property(str, "readable")
def player_name(self): def player_name(self):
@@ -256,7 +253,7 @@ class MprisPlayer(Service):
): ):
# Only One Signal for Mpris # Only One Signal for Mpris
if signal_name == "Seeked": 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]): def _proxy_call(self, method_name: str, parameter: Optional[GLib.Variant]):
self._dbus_helper.proxy.call( self._dbus_helper.proxy.call(