fix(services): clean up importsand simplify Seeked handling
- New Features: - Enhancements: Added module‑level logger import. - Bug Fixes: Simplified Seeked handling and corrected metadata type annotation.
This commit is contained in:
2 files changed
+5
-6
No files matched your search
@@ -12,7 +12,7 @@ from fabric.notifications import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Fabric imports
|
# Fabric imports
|
||||||
from fabric.utils import GdkPixbuf, os
|
from fabric.utils import GdkPixbuf, os, logger
|
||||||
|
|
||||||
import config.data as data
|
import config.data as data
|
||||||
|
|
||||||
@@ -295,8 +295,6 @@ class CachedNotifications(Notifications):
|
|||||||
# Don't call super() - we're handling this ourselves
|
# Don't call super() - we're handling this ourselves
|
||||||
|
|
||||||
# Import logger at the top of the function
|
# Import logger at the top of the function
|
||||||
from loguru import logger
|
|
||||||
|
|
||||||
notification = self.get_notification_from_id(notification_id)
|
notification = self.get_notification_from_id(notification_id)
|
||||||
|
|
||||||
if not notification:
|
if not notification:
|
||||||
|
|||||||
+4
-3
@@ -8,7 +8,6 @@ from fabric.utils.helpers import (
|
|||||||
pascal_case_to_snake_case,
|
pascal_case_to_snake_case,
|
||||||
snake_case_to_kebab_case,
|
snake_case_to_kebab_case,
|
||||||
)
|
)
|
||||||
from gi.repository.GLib import Variant
|
|
||||||
|
|
||||||
from utils.dbus_helper import GioDBusHelper
|
from utils.dbus_helper import GioDBusHelper
|
||||||
|
|
||||||
@@ -86,7 +85,9 @@ class MprisPlayer(Service):
|
|||||||
|
|
||||||
@Property(dict, "readable")
|
@Property(dict, "readable")
|
||||||
def metadata(self) -> dict:
|
def metadata(self) -> dict:
|
||||||
prop: Variant | None = self._dbus_helper.proxy.get_cached_property("Metadata") # type: ignore
|
prop: GLib.Variant | None = self._dbus_helper.proxy.get_cached_property(
|
||||||
|
"Metadata"
|
||||||
|
) # type: ignore
|
||||||
return dict(prop) if prop else {} # type: ignore
|
return dict(prop) if prop else {} # type: ignore
|
||||||
|
|
||||||
# RELY ON METADATA
|
# RELY ON METADATA
|
||||||
@@ -253,7 +254,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].get_int64())
|
self.seeked(params[0])
|
||||||
|
|
||||||
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(
|
||||||
|
|||||||
Reference in new issue
Block a user