From e6738bcd3e0c2a61cf9b7024e43881335ddb8160 Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 17:07:40 +0200 Subject: [PATCH] feat(cmd): wireUploads -- limits, chat budget and chat model into the web App Co-Authored-By: Claude Sonnet 5.5 --- cmd/tapir/uploads.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/tapir/uploads.go b/cmd/tapir/uploads.go index ebe5339..0da0d53 100644 --- a/cmd/tapir/uploads.go +++ b/cmd/tapir/uploads.go @@ -12,6 +12,7 @@ import ( "git.d-ma.be/mathias/tapir/internal/adapters/transcribe" "git.d-ma.be/mathias/tapir/internal/config" "git.d-ma.be/mathias/tapir/internal/uploads" + "git.d-ma.be/mathias/tapir/internal/web" ) // uploadsStore is the store surface the upload wiring needs. *store.Store @@ -83,3 +84,17 @@ func removeSpooledAudio(dir string, log *slog.Logger) { } } } + +// wireUploads connects a built Intake to the web App: the routes, the limits the +// form states, and the chat settings for an uploaded recording. A nil intake +// leaves the App untouched — assigning a nil *Intake to the Uploader interface +// would produce a non-nil interface and mount the routes over nothing. +func wireUploads(app *web.App, cfg config.Config, in *uploads.Intake) { + if in == nil { + return + } + app.Uploads = in + app.UploadLimits = uploadLimits(cfg) + app.UploadChatMaxChars = cfg.MaxUploadedTranscriptChars + app.UploadChatModel = cfg.UploadChatModel +}