Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions plugins/platforms/discord/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3814,6 +3814,8 @@ def _playback_timeout_limit(self) -> int:

def _probe_audio_duration_seconds(self, audio_path: str) -> Optional[float]:
"""Best-effort audio duration probe used to size playback timeouts."""
from hermes_cli._subprocess_compat import windows_hide_flags

try:
import importlib
mutagen = importlib.import_module("mutagen")
Expand All @@ -3838,6 +3840,7 @@ def _probe_audio_duration_seconds(self, audio_path: str) -> Optional[float]:
text=True,
timeout=5,
stdin=subprocess.DEVNULL,
creationflags=windows_hide_flags(),
)
if proc.returncode == 0:
raw = (proc.stdout or "").strip()
Expand Down
7 changes: 7 additions & 0 deletions plugins/platforms/matrix/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def _matrix_voice_metadata_for_file(path: Path) -> Dict[str, Any]:
extraction is deliberately best-effort: media delivery must still work on
systems without ffprobe/ffmpeg.
"""
from hermes_cli._subprocess_compat import windows_hide_flags

metadata: Dict[str, Any] = {}

ffprobe = shutil.which("ffprobe")
Expand All @@ -171,6 +173,7 @@ def _matrix_voice_metadata_for_file(path: Path) -> Dict[str, Any]:
text=True,
timeout=10,
stdin=subprocess.DEVNULL,
creationflags=windows_hide_flags(),
)
if result.returncode == 0:
duration = float((result.stdout or "").strip() or 0)
Expand Down Expand Up @@ -200,6 +203,7 @@ def _matrix_voice_metadata_for_file(path: Path) -> Dict[str, Any]:
capture_output=True,
timeout=15,
stdin=subprocess.DEVNULL,
creationflags=windows_hide_flags(),
)
if result.returncode == 0 and result.stdout:
samples = array.array("h")
Expand Down Expand Up @@ -228,6 +232,8 @@ def _matrix_transcode_voice_to_ogg(path: str) -> Optional[str]:
original file, matching the adapter's previous behaviour. Runs blocking
subprocess work; call via ``asyncio.to_thread`` from async code.
"""
from hermes_cli._subprocess_compat import windows_hide_flags

ffmpeg = shutil.which("ffmpeg")
if not ffmpeg:
return None
Expand Down Expand Up @@ -261,6 +267,7 @@ def _matrix_transcode_voice_to_ogg(path: str) -> Optional[str]:
capture_output=True,
timeout=30,
stdin=subprocess.DEVNULL,
creationflags=windows_hide_flags(),
)
if result.returncode == 0 and os.path.getsize(ogg_path) > 0:
return ogg_path
Expand Down
3 changes: 3 additions & 0 deletions plugins/platforms/simplex/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ def _prepare_image(file_path: str) -> tuple[str, str]:
"""
import subprocess
import tempfile
from hermes_cli._subprocess_compat import windows_hide_flags

p = Path(file_path)
png_path = file_path
Expand Down Expand Up @@ -900,6 +901,7 @@ def _prepare_image(file_path: str) -> tuple[str, str]:
check=True,
capture_output=True,
timeout=30,
creationflags=windows_hide_flags(),
)
with tempfile.NamedTemporaryFile(suffix=".jpg", delete=False) as tmp:
tmp_path = tmp.name
Expand All @@ -916,6 +918,7 @@ def _prepare_image(file_path: str) -> tuple[str, str]:
check=True,
capture_output=True,
timeout=30,
creationflags=windows_hide_flags(),
)
with open(tmp_path, "rb") as f:
thumb_uri = (
Expand Down
Loading