h
This commit is contained in:
19
MPV/lyric.py
19
MPV/lyric.py
@@ -557,24 +557,7 @@ def _load_config_best_effort() -> dict:
|
||||
try:
|
||||
from SYS.config import load_config
|
||||
|
||||
# `SYS.config.load_config()` defaults to loading `config.conf` from the
|
||||
# SYS/ directory, but this repo keeps `config.conf` at the repo root.
|
||||
# MPV.lyric is often spawned from mpv (not the CLI), so we must locate
|
||||
# the repo root ourselves.
|
||||
try:
|
||||
repo_root = Path(__file__).resolve().parent.parent
|
||||
except Exception:
|
||||
repo_root = None
|
||||
|
||||
cfg = None
|
||||
if repo_root is not None:
|
||||
try:
|
||||
cfg = load_config(config_dir=repo_root)
|
||||
except Exception:
|
||||
cfg = None
|
||||
|
||||
if cfg is None:
|
||||
cfg = load_config()
|
||||
cfg = load_config()
|
||||
|
||||
return cfg if isinstance(cfg, dict) else {}
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user