mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 11:40:57 +02:00
Fix empty voice list when launched via desktop shortcut
PluginManager.discover() used a relative path 'plugins', which resolved against the CWD. When launched from a desktop shortcut the CWD is ~, so the plugins directory was never found and no voices appeared in the list. Fall back to the project-relative plugins path when the default relative path doesn't resolve.
This commit is contained in:
@@ -41,6 +41,9 @@ class PluginManager:
|
|||||||
self._engines.clear()
|
self._engines.clear()
|
||||||
|
|
||||||
plugins_path = Path(plugins_dir)
|
plugins_path = Path(plugins_dir)
|
||||||
|
if not plugins_path.exists():
|
||||||
|
if plugins_dir == "plugins":
|
||||||
|
plugins_path = Path(__file__).resolve().parent.parent.parent / "plugins"
|
||||||
if not plugins_path.exists():
|
if not plugins_path.exists():
|
||||||
self._loaded = True
|
self._loaded = True
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user