fix(dashcam): add missing dash-col CSS rules, correct MOV mime type and range clamp

- yaris.css: add dash-col-size/date/upload hide rules on mobile (<576px),
  dash-col-file truncation on tablet, btn-icon-mobile label hide
- app.py: clamp byte2 to file_size-1 to prevent Content-Length mismatch;
  detect MIME from file extension (.mov -> video/quicktime)

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-10 00:12:33 -04:00
co-authored by Copilot
parent 375b93fcea
commit ea03ef7f6c
2 changed files with 23 additions and 6 deletions
+5 -3
View File
@@ -150,16 +150,18 @@ def local_video_file():
except FileNotFoundError:
return jsonify(error=f"Local video not found: {relative_path}"), 404
ext = os.path.splitext(path)[1].lower()
mime_map = {".mp4": "video/mp4", ".mov": "video/quicktime", ".avi": "video/x-msvideo", ".mkv": "video/x-matroska"}
mime = mime_map.get(ext, "video/mp4")
file_size = os.path.getsize(path)
mime = "video/mp4"
range_header = request.headers.get("Range")
if range_header:
# Parse "bytes=start-end"
byte1, byte2 = 0, None
m = range_header.strip().replace("bytes=", "").split("-")
byte1 = int(m[0]) if m[0] else 0
byte2 = int(m[1]) if len(m) > 1 and m[1] else file_size - 1
byte2 = min(byte2, file_size - 1)
length = byte2 - byte1 + 1
def generate_range():