feat: P1 — audio/video modal player + MIME detection via magic bytes (infer)

Backend:
- Add infer crate for magic-byte MIME detection (<1μs per file)
- New src/common/mime_detect.rs: refine_content_type() with priority
  magic bytes > extension > client Content-Type
- Inject MIME refinement in file upload handler (after spool to temp)
- Inject MIME refinement in chunked upload handler (after assembly)

Frontend:
- Extend isViewableFile() to include audio/* and video/*
- Add createMediaViewer() to InlineViewer with <audio>/<video> controls
- Blob URL pattern for authenticated streaming playback
- Graceful fallback for unsupported codecs (error message + download)
- CSS: video player, audio wrapper with animated icon, responsive
This commit is contained in:
Dionisio
2026-02-24 23:15:10 +01:00
parent 9f692f03c3
commit 7786871d6c
9 changed files with 303 additions and 0 deletions
+1
View File
@@ -49,6 +49,7 @@ reqwest = { version = "0.12", default-features = false, features = ["json", "rus
base64 = "0.22.1"
fs2 = "0.4"
rayon = "1.10"
infer = "0.19"
async-compression = { version = "0.4", features = ["tokio", "gzip"] }
async_zip = { version = "0.0.18", features = ["tokio", "deflate"] }