Top-level imports; catch only expected exceptions
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:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user