f
This commit is contained in:
@@ -192,34 +192,6 @@ def update_medios_config(hydrus_path: Path) -> bool:
|
||||
except Exception as e:
|
||||
logging.error("Failed to update medios.db: %s", e)
|
||||
|
||||
# Fallback to config.conf
|
||||
if not config_path.exists():
|
||||
logging.debug("MM config.conf not found at %s; skipping legacy auto-link.", config_path)
|
||||
return False
|
||||
|
||||
try:
|
||||
content = config_path.read_text(encoding="utf-8")
|
||||
key = "gitclone"
|
||||
value = hydrus_abs_path
|
||||
|
||||
# Pattern to replace existing gitclone in the hydrusnetwork section
|
||||
pattern = rf'^(\s*{re.escape(key)}\s*=\s*)(.*)$'
|
||||
if re.search(pattern, content, flags=re.MULTILINE):
|
||||
new_content = re.sub(pattern, rf'\1"{value}"', content, flags=re.MULTILINE)
|
||||
else:
|
||||
section_pattern = r'\[store=hydrusnetwork\]'
|
||||
if re.search(section_pattern, content):
|
||||
new_content = re.sub(section_pattern, f'[store=hydrusnetwork]\n{key}="{value}"', content, count=1)
|
||||
else:
|
||||
new_content = content + f'\n\n[store=hydrusnetwork]\nname="hydrus"\n{key}="{value}"'
|
||||
|
||||
if new_content != content:
|
||||
config_path.write_text(new_content, encoding="utf-8")
|
||||
logging.info("✅ Linked Hydrus installation in Medios-Macina config (gitclone=\"%s\")", value)
|
||||
return True
|
||||
except Exception as e:
|
||||
logging.error("Failed to update config.conf: %s", e)
|
||||
return False
|
||||
return False
|
||||
|
||||
|
||||
@@ -1124,6 +1096,7 @@ 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",
|
||||
@@ -1140,6 +1113,11 @@ def main(argv: Optional[list[str]] = None) -> int:
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
except Exception:
|
||||
if mod == "mpv":
|
||||
# python-mpv requires system libmpv; failure is common on server/headless envs
|
||||
logging.info("Package '%s' is installed, but 'import %s' failed (likely missing system libmpv). This is usually non-critical.", pkg, mod)
|
||||
continue
|
||||
|
||||
logging.warning(
|
||||
"Package '%s' not importable inside venv (module %s)",
|
||||
pkg,
|
||||
@@ -1439,6 +1417,7 @@ 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",
|
||||
@@ -1476,6 +1455,11 @@ def main(argv: Optional[list[str]] = None) -> int:
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
except subprocess.CalledProcessError:
|
||||
if import_name == "mpv":
|
||||
# python-mpv requires system libmpv; failure is common on server/headless envs
|
||||
logging.info("Package '%s' is installed, but 'import %s' failed (likely missing system libmpv). This is usually non-critical.", pkg, import_name)
|
||||
continue
|
||||
|
||||
logging.warning(
|
||||
"Package '%s' appears installed but 'import %s' failed inside venv.",
|
||||
pkg,
|
||||
|
||||
Reference in New Issue
Block a user