Top-level imports; catch only expected exceptions
release / gui-build (linux, bash) (push) Successful in 56s
release / gui-build (windows, cmd) (push) Failing after 1m37s
release / gui-build (macos, bash) (push) Failing after 13m21s

velopack/tracerite/fastapi-vue are always available in the GUI build, so
drop the in-function import guards. The update checker now catches only
RuntimeError (not a Velopack install: dev/portable) and OSError
(network). Build script and PyInstaller spec use platformdirs for the
persistent tool cache.
This commit is contained in:
2026-09-23 00:44:10 +00:00
parent 50420984f1
commit e514829737
3 changed files with 23 additions and 47 deletions
+3 -6
View File
@@ -7,7 +7,6 @@
# Or use the build script (recommended—handles versioning and packaging):
# uv run scripts/guibuild.py
import os
import sys
import mediahive.winmain
import mediahive.server
@@ -23,11 +22,9 @@ _icon_win = _pkg / "assets" / "mediahive.ico"
_icon_mac = _pkg / "assets" / "mediahive.icns"
# ffmpeg staging lives in the persistent build cache (same logic as
# scripts/guibuild.py); fall back to the legacy build/ffmpeg location.
if sys.platform == "win32":
_cache_base = Path(os.environ.get("LOCALAPPDATA", Path.home() / "AppData" / "Local"))
else:
_cache_base = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache"))
_tools_dir = _cache_base / "mediahive-build" / "ffmpeg"
from platformdirs import user_cache_path
_tools_dir = user_cache_path("mediahive-build") / "ffmpeg"
if not _tools_dir.exists():
_tools_dir = Path(SPECPATH).parent / "build" / "ffmpeg"
_tool_names = ["ffmpeg.exe"] if sys.platform == "win32" else ["ffmpeg"]
+2 -5
View File
@@ -31,6 +31,7 @@ import zipfile
from pathlib import Path
import setuptools_scm
from platformdirs import user_cache_path
# BtbN automated builds always publish a 'latest' tag with this asset.
_FFMPEG_URL = (
@@ -46,11 +47,7 @@ _ASSETS_DIR = _REPO_ROOT / "mediahive" / "assets"
def _build_cache_dir() -> Path:
"""Return the persistent cross-build cache dir for downloaded tools (CI wipes build/)."""
if sys.platform == "win32":
base = os.environ.get("LOCALAPPDATA") or (Path.home() / "AppData" / "Local")
return Path(base) / "mediahive-build"
base = os.environ.get("XDG_CACHE_HOME") or (Path.home() / ".cache")
return Path(base) / "mediahive-build"
return user_cache_path("mediahive-build")
_FFMPEG_STAGING = _build_cache_dir() / "ffmpeg"