feat(uploads): choose the language of a recording; Swedish default, Other = auto (#61 interim) #62

Merged
mathias merged 10 commits from sprint/language into main 2026-10-05 04:59:03 +00:00
Showing only changes of commit cc6fe7083d - Show all commits
+2 -2
View File
@@ -36,7 +36,7 @@ const (
// and the title field; the cap itself is enforced on the file part by Intake.
uploadOverhead = 1 << 20
maxTitleRunes = 200
// maxLanguageBytes bounds the language field: the longest value is four bytes.
// maxLanguageBytes bounds what is read of the language field; a valid value is at most four bytes, so a longer one fails the parse.
maxLanguageBytes = 16
// uploadPollEvery is how often an unfinished upload re-asks for its status.
uploadPollEvery = "2s"
@@ -136,7 +136,7 @@ func (a *App) handleUploadPost(w http.ResponseWriter, r *http.Request) {
return
}
l, ok := domain.ParseLanguage(string(b))
if !ok || len(b) > maxLanguageBytes {
if !ok {
a.logger().Info("upload rejected", "reason", "language")
a.renderUploadsPage(w, r, userID, http.StatusBadRequest, "Choose a language from the list.")
return