Fixed resolve_path logic

This commit is contained in:
Sumner Evans
2020-08-02 13:22:05 -06:00
parent 103b38a18e
commit 0a5faa2bde
2 changed files with 2 additions and 2 deletions

View File

@@ -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())

View File

@@ -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(