By: Michael Lynch <git@mtlynch.io>
Simplify video upload code after review Remove redundant complexity surfaced in review, with no behavior change for any reachable input: - Delete uploadTooLargeError and the per-file size cap in copyToTempFile. Each route's http.MaxBytesReader uses the same ceiling as the per-file cap, and the multipart body is always larger than the file alone, so MaxBytesReader always trips first. The per-file cap was unreachable. - Revert WriteProduced; its only caller was WriteConverted. Restore the original temp-file-then-WriteFile implementation. - Probe video duration once: thread the already-probed duration into ProcessVideo so thumbnailSeekOffset no longer reruns ffprobe. - Drop runMediaCommand's exec.ErrNotFound special-case; the default command error is already actionable. - Inline spillToTempFile back into its single caller, restoring the plain-defer cleanup shape. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>