diff --git a/sublime/dbus/manager.py b/sublime/dbus/manager.py index 169a358..c61633e 100644 --- a/sublime/dbus/manager.py +++ b/sublime/dbus/manager.py @@ -70,7 +70,7 @@ class DBusManager: "org.mpris.MediaPlayer2.TrackList.xml", ] for spec in specs: - spec_path = resolve_path(f"dbus/mpris_specs/{spec}") + spec_path = resolve_path("dbus/mpris_specs", spec) with open(spec_path) as f: node_info = Gio.DBusNodeInfo.new_for_xml(f.read()) diff --git a/sublime/util.py b/sublime/util.py index 91f6309..406d5f3 100644 --- a/sublime/util.py +++ b/sublime/util.py @@ -5,7 +5,7 @@ from typing import Union def resolve_path(*joinpath_args: Union[str, Path]) -> Path: roots = (Path(__file__).parent, Path("/usr/share/sublime-music")) for root in roots: - if fullpath := root.joinpath(*joinpath_args).resolve(): + if (fullpath := root.joinpath(*joinpath_args).resolve()).exists(): return fullpath raise FileNotFoundError(