fix(02): Alpine libmpv/libsndfile symlinks, upload endpoint, browser file picker
- Dockerfile: add libmpv.so + libsndfile.so symlinks (Alpine/musl has no ldconfig) - engine.py: monkey-patch ctypes.util.find_library as fallback for Alpine - audio.py: add /upload (multipart) and /files endpoints - pyproject.toml: add python-multipart - frontend: replace path input with upload button + file selector dropdown
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
"""MPV-based audio engine — headless playback with 10Hz position polling."""
|
||||
import ctypes.util as _ctypes_util
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from typing import Any
|
||||
|
||||
import mpv
|
||||
# Alpine/musl: ctypes.util.find_library can't discover libmpv without ldconfig or objdump.
|
||||
# Patch it to return the known path so python-mpv can load the library.
|
||||
_orig_find_library = _ctypes_util.find_library
|
||||
def _patched_find_library(name: str) -> str | None:
|
||||
if name == "mpv":
|
||||
return "/usr/lib/libmpv.so.2"
|
||||
return _orig_find_library(name)
|
||||
_ctypes_util.find_library = _patched_find_library
|
||||
|
||||
import mpv # noqa: E402
|
||||
|
||||
_ctypes_util.find_library = _orig_find_library # restore after mpv loaded
|
||||
|
||||
|
||||
def apply_timer_fix() -> None:
|
||||
|
||||
Reference in New Issue
Block a user