update refactoring and add new features
This commit is contained in:
@@ -61,17 +61,22 @@ def _runtime_config_root() -> Path:
|
||||
|
||||
|
||||
# Make repo-local packages importable even when mpv starts us from another cwd.
|
||||
_ROOT = str(_repo_root())
|
||||
if _ROOT not in sys.path:
|
||||
sys.path.insert(0, _ROOT)
|
||||
|
||||
from plugins.mpv.mpv_ipc import MPVIPCClient, _windows_kill_pids, _windows_hidden_subprocess_kwargs, _windows_list_mpv_pids # noqa: E402
|
||||
from SYS.config import load_config, reload_config # noqa: E402
|
||||
from SYS.logger import set_debug, debug, set_thread_stream # noqa: E402
|
||||
from SYS.repl_queue import enqueue_repl_command, repl_state_is_alive # noqa: E402
|
||||
from SYS.utils import format_bytes # noqa: E402
|
||||
from PluginCore.registry import get_plugin, get_plugin_class # noqa: E402
|
||||
from plugins.ytdlp.tooling import get_display_format_id, get_selection_format_id # noqa: E402
|
||||
_root_str = str(_repo_root())
|
||||
_path_added = _root_str not in sys.path
|
||||
if _path_added:
|
||||
sys.path.insert(0, _root_str)
|
||||
try:
|
||||
from plugins.mpv.mpv_ipc import MPVIPCClient, _windows_kill_pids, _windows_hidden_subprocess_kwargs, _windows_list_mpv_pids # noqa: E402
|
||||
from SYS.config import load_config, reload_config # noqa: E402
|
||||
from SYS.logger import set_debug, debug, set_thread_stream # noqa: E402
|
||||
from SYS.repl_queue import enqueue_repl_command, repl_state_is_alive # noqa: E402
|
||||
from SYS.utils import format_bytes # noqa: E402
|
||||
from PluginCore.registry import get_plugin, get_plugin_class # noqa: E402
|
||||
from plugins.ytdlp.tooling import get_display_format_id, get_selection_format_id # noqa: E402
|
||||
finally:
|
||||
if _path_added:
|
||||
sys.path.remove(_root_str)
|
||||
del _root_str, _path_added
|
||||
|
||||
REQUEST_PROP = "user-data/medeia-pipeline-request"
|
||||
RESPONSE_PROP = "user-data/medeia-pipeline-response"
|
||||
|
||||
Reference in New Issue
Block a user