Upload panel: drag-drop multi-file queue, parallel uploads, MP4+AVI support, styled UI

This commit is contained in:
2026-08-28 14:46:36 +01:00
parent 35be3fc2e7
commit 3a858c9a55
2 changed files with 153 additions and 35 deletions
+8 -5
View File
@@ -163,12 +163,15 @@ class PlayerHandler(BaseHTTPRequestHandler):
except ValueError:
return self.send_error(400, "date must be YYYYMMDD or YYYY-MM-DD")
suffix = match.group(4).lower()
if suffix == "avi":
return self.send_error(400, "Only pre-encoded .mp4 uploads are accepted; AVI sources go through the Encoding menu")
if suffix not in ("mp4", "avi"):
return self.send_error(400, "Only .mp4 or .avi uploads are accepted")
target_dir = self.server.output_root / day
target = target_dir / f"{hour:02d}.{minute:02d}.{second:02d}.mp4"
temporary = target.with_suffix(".uploading.mp4")
if suffix == "avi":
# AVI sources mirror the real recorder: stored in the source tree for the Encoding menu
target_dir = self.server.source_root / day
target = target_dir / f"{hour:02d}.{minute:02d}.{second:02d}.{suffix}"
temporary = target.with_suffix(f".uploading.{suffix}")
try:
target_dir.mkdir(parents=True, exist_ok=True)
received = 0
@@ -187,7 +190,7 @@ class PlayerHandler(BaseHTTPRequestHandler):
temporary.unlink(missing_ok=True)
return self.send_error(500, "Failed to store upload")
self.server.recordings.setdefault(day, [])
if not any(clip["name"] == target.name for clip in self.server.recordings[day]):
if suffix == "mp4" and not any(clip["name"] == target.name for clip in self.server.recordings[day]):
self.server.recordings[day].append({
"name": target.name,
"start": hour * 3600 + minute * 60 + second,