F
This commit is contained in:
@@ -75,12 +75,31 @@ def import_cmd_module(mod_name: str):
|
|||||||
return None
|
return None
|
||||||
for package in ("cmdnat", "cmdlet", None):
|
for package in ("cmdnat", "cmdlet", None):
|
||||||
try:
|
try:
|
||||||
|
# When attempting a bare import (package is None), prefer the repo-local
|
||||||
|
# `MPV` package for the `mpv` module name so we don't accidentally
|
||||||
|
# import the third-party `mpv` package (python-mpv) which can raise
|
||||||
|
# OSError if system libmpv is missing.
|
||||||
|
if package is None and normalized == "mpv":
|
||||||
|
try:
|
||||||
|
return import_module("MPV")
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
# Local MPV package not present; fall back to the normal bare import.
|
||||||
|
pass
|
||||||
|
|
||||||
qualified = f"{package}.{normalized}" if package else normalized
|
qualified = f"{package}.{normalized}" if package else normalized
|
||||||
return import_module(qualified)
|
return import_module(qualified)
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
|
# Module not available in this package prefix; try the next.
|
||||||
continue
|
continue
|
||||||
except Exception as exc:
|
except (ImportError, OSError) as exc:
|
||||||
logger.exception("Unexpected error importing module %s: %s", qualified, exc)
|
# Some native/binary-backed packages (e.g., mpv) raise ImportError/OSError
|
||||||
|
# on systems missing shared libraries. These are optional; log a short
|
||||||
|
# warning but avoid spamming the console with a full traceback.
|
||||||
|
logger.warning("Optional module %s failed to import: %s", qualified, exc)
|
||||||
|
continue
|
||||||
|
except Exception:
|
||||||
|
# Unexpected errors should be loud and include a traceback to aid debugging.
|
||||||
|
logger.exception("Unexpected error importing module %s", qualified)
|
||||||
continue
|
continue
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -1353,7 +1353,8 @@ class PipelineExecutor:
|
|||||||
def _add(value) -> None:
|
def _add(value) -> None:
|
||||||
try:
|
try:
|
||||||
text = str(value or "").strip().lower()
|
text = str(value or "").strip().lower()
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
|
logger.debug("Failed to normalize candidate value: %s", exc, exc_info=True)
|
||||||
return
|
return
|
||||||
if not text or text in seen:
|
if not text or text in seen:
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -568,3 +568,7 @@ http://10.162.158.28:45899/get_files/file?hash=5c7296f1a5544522e3d118f60080e0389
|
|||||||
2026-01-31T03:13:22.207331Z [DEBUG] logger.debug: DEBUG: <rich.panel.Panel object at 0x00000161B7383D10>
|
2026-01-31T03:13:22.207331Z [DEBUG] logger.debug: DEBUG: <rich.panel.Panel object at 0x00000161B7383D10>
|
||||||
2026-01-31T03:13:39.166965Z [DEBUG] alldebrid.search: [alldebrid] Failed to list account magnets: AllDebrid API error: The auth apikey is invalid
|
2026-01-31T03:13:39.166965Z [DEBUG] alldebrid.search: [alldebrid] Failed to list account magnets: AllDebrid API error: The auth apikey is invalid
|
||||||
2026-02-01T00:05:13.728816Z [DEBUG] logger.debug: DEBUG: [Store] Unknown store type 'debrid'
|
2026-02-01T00:05:13.728816Z [DEBUG] logger.debug: DEBUG: [Store] Unknown store type 'debrid'
|
||||||
|
2026-02-01T04:23:03.090858Z [DEBUG] logger.debug: DEBUG: [Store] Unknown store type 'debrid'
|
||||||
|
2026-02-01T04:23:19.808488Z [DEBUG] logger.debug: DEBUG: [Store] Unknown store type 'debrid'
|
||||||
|
2026-02-01T04:23:36.282589Z [DEBUG] search_file.run: Backend all-debrid search failed: "Unknown store backend: all-debrid. Available: ['rpi', 'local']"
|
||||||
|
2026-02-01T04:23:52.712154Z [DEBUG] logger.debug: DEBUG: [search-file] Searching 'local'
|
||||||
|
|||||||
@@ -1508,27 +1508,21 @@ def main() -> int:
|
|||||||
|
|
||||||
# 7. CLI Verification
|
# 7. CLI Verification
|
||||||
pb.update("Verifying CLI configuration...")
|
pb.update("Verifying CLI configuration...")
|
||||||
# Check core dependencies (including mpv) before finalizing
|
# Check core imports (skip optional python-mpv here because it depends on
|
||||||
|
# the system libmpv shared library and is not required for the repo-local
|
||||||
|
# MPV IPC integration; MPV executable availability is handled below.)
|
||||||
try:
|
try:
|
||||||
# Check basic imports and specifically mpv
|
|
||||||
missing = []
|
missing = []
|
||||||
for mod in ["importlib", "shutil", "subprocess", "mpv"]:
|
for mod in ["importlib", "shutil", "subprocess"]:
|
||||||
try:
|
try:
|
||||||
# Use run() for verification to ensure clean environment
|
# Use run() for verification to ensure clean environment
|
||||||
run([str(venv_python), "-c", f"import {mod}"], quiet=True)
|
run([str(venv_python), "-c", f"import {mod}"], quiet=True)
|
||||||
except Exception:
|
except Exception:
|
||||||
missing.append(mod)
|
missing.append(mod)
|
||||||
|
|
||||||
if missing:
|
# Note: If the MPV executable is missing it will be handled by the
|
||||||
# If mpv is missing, it might be because python-mpv wasn't in requirements.txt
|
# MPV installation step later in this script; do not attempt to
|
||||||
# or failed to install. Try installing it explicitly.
|
# install the third-party `python-mpv` package here.
|
||||||
if "mpv" in missing:
|
|
||||||
try:
|
|
||||||
_run_cmd([str(venv_python), "-m", "pip", "install", "--no-cache-dir", "python-mpv"])
|
|
||||||
missing.remove("mpv")
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if missing:
|
if missing:
|
||||||
print(f"\nWarning: The following packages were not importable in the venv: {', '.join(missing)}")
|
print(f"\nWarning: The following packages were not importable in the venv: {', '.join(missing)}")
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
@@ -1123,7 +1123,6 @@ def main(argv: Optional[list[str]] = None) -> int:
|
|||||||
"show-in-file-manager": "showinfm",
|
"show-in-file-manager": "showinfm",
|
||||||
"opencv-python-headless": "cv2",
|
"opencv-python-headless": "cv2",
|
||||||
"mpv": "mpv",
|
"mpv": "mpv",
|
||||||
"python-mpv": "mpv",
|
|
||||||
"pyside6": "PySide6",
|
"pyside6": "PySide6",
|
||||||
"pyside6-essentials": "PySide6",
|
"pyside6-essentials": "PySide6",
|
||||||
"pyside6-addons": "PySide6",
|
"pyside6-addons": "PySide6",
|
||||||
@@ -1448,7 +1447,6 @@ def main(argv: Optional[list[str]] = None) -> int:
|
|||||||
"show-in-file-manager": "showinfm",
|
"show-in-file-manager": "showinfm",
|
||||||
"opencv-python-headless": "cv2",
|
"opencv-python-headless": "cv2",
|
||||||
"mpv": "mpv",
|
"mpv": "mpv",
|
||||||
"python-mpv": "mpv",
|
|
||||||
"pyside6": "PySide6",
|
"pyside6": "PySide6",
|
||||||
"pyside6-essentials": "PySide6",
|
"pyside6-essentials": "PySide6",
|
||||||
"pyside6-addons": "PySide6",
|
"pyside6-addons": "PySide6",
|
||||||
|
|||||||
Reference in New Issue
Block a user