This commit is contained in:
2026-01-31 20:24:15 -08:00
parent 1dbaabac73
commit bc3dbf28e8
5 changed files with 35 additions and 19 deletions

View File

@@ -75,12 +75,31 @@ def import_cmd_module(mod_name: str):
return None
for package in ("cmdnat", "cmdlet", None):
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
return import_module(qualified)
except ModuleNotFoundError:
# Module not available in this package prefix; try the next.
continue
except Exception as exc:
logger.exception("Unexpected error importing module %s: %s", qualified, exc)
except (ImportError, OSError) as 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
return None

View File

@@ -1353,7 +1353,8 @@ class PipelineExecutor:
def _add(value) -> None:
try:
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
if not text or text in seen:
return

View File

@@ -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: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-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'

View File

@@ -1508,27 +1508,21 @@ def main() -> int:
# 7. CLI Verification
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:
# Check basic imports and specifically mpv
missing = []
for mod in ["importlib", "shutil", "subprocess", "mpv"]:
for mod in ["importlib", "shutil", "subprocess"]:
try:
# Use run() for verification to ensure clean environment
run([str(venv_python), "-c", f"import {mod}"], quiet=True)
except Exception:
missing.append(mod)
if missing:
# If mpv is missing, it might be because python-mpv wasn't in requirements.txt
# or failed to install. Try installing it explicitly.
if "mpv" in missing:
try:
_run_cmd([str(venv_python), "-m", "pip", "install", "--no-cache-dir", "python-mpv"])
missing.remove("mpv")
except Exception:
pass
# Note: If the MPV executable is missing it will be handled by the
# MPV installation step later in this script; do not attempt to
# install the third-party `python-mpv` package here.
if missing:
print(f"\nWarning: The following packages were not importable in the venv: {', '.join(missing)}")
except Exception:

View File

@@ -1123,7 +1123,6 @@ def main(argv: Optional[list[str]] = None) -> int:
"show-in-file-manager": "showinfm",
"opencv-python-headless": "cv2",
"mpv": "mpv",
"python-mpv": "mpv",
"pyside6": "PySide6",
"pyside6-essentials": "PySide6",
"pyside6-addons": "PySide6",
@@ -1448,7 +1447,6 @@ def main(argv: Optional[list[str]] = None) -> int:
"show-in-file-manager": "showinfm",
"opencv-python-headless": "cv2",
"mpv": "mpv",
"python-mpv": "mpv",
"pyside6": "PySide6",
"pyside6-essentials": "PySide6",
"pyside6-addons": "PySide6",