From 01eab1ab6f9cadab30ae4eef0de55288251a305e Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 18:43:00 +0200 Subject: [PATCH] feat(uploads): a video track is no longer a reason to reject (ADR-033) Only no-audio, unreadable length and too-long are refused. ReasonVideo is gone. Co-Authored-By: Claude Sonnet 5.5 --- internal/uploads/validate.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/internal/uploads/validate.go b/internal/uploads/validate.go index 8dfea85..d2e4f49 100644 --- a/internal/uploads/validate.go +++ b/internal/uploads/validate.go @@ -18,8 +18,8 @@ type Limits struct { } // Probe is what inspecting an uploaded file revealed. It is the input to Validate -// because a name or MIME type cannot say whether a container carries video: a -// Teams voice-only export is typically an .mp4 with no video stream. +// because a name or MIME type cannot say what a container holds: a Teams recording +// is an .mp4 whether or not the camera was on. type Probe struct { Duration time.Duration HasAudio bool @@ -30,7 +30,6 @@ type Probe struct { type Reason string const ( - ReasonVideo Reason = "video" ReasonNoAudio Reason = "no_audio" ReasonTooLong Reason = "too_long" ReasonTooLarge Reason = "too_large" @@ -46,13 +45,13 @@ type RejectError struct { func (e *RejectError) Error() string { return string(e.Reason) + ": " + e.Message } -// Validate decides whether a probed file may be transcribed. Video is checked -// first so a video file is always refused as video, whatever its length. +// Validate decides whether a probed file may be transcribed. A video track is NOT +// a reason to refuse: a Teams meeting with the camera off is still an .mp4 with a +// video track, so rejecting video would reject the primary use case. Only the audio +// is used (Probe.HasVideo is recorded so the user can be told the video was +// ignored). What IS refused: no audio at all, an unreadable length, too long. func Validate(p Probe, l Limits) error { switch { - case p.HasVideo: - return &RejectError{Reason: ReasonVideo, Message: "This file contains a video track. " + - "Only audio recordings are supported for now; video upload is tracked in issue #28."} case !p.HasAudio: return &RejectError{Reason: ReasonNoAudio, Message: "This file has no audio track to transcribe."} case p.Duration <= 0: