summaryrefslogtreecommitdiff
path: root/cmd/mediaplayer/main.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-03 20:18:26 +0300
committerPaul Buetow <paul@buetow.org>2026-05-03 20:18:26 +0300
commitdeba845a03de659b490452e00f7b7d501ba1fdb2 (patch)
treeeb719c2a629316fc166961560942508a4542d6d6 /cmd/mediaplayer/main.go
parentdf8f3713abee8b5ec53b5751032200b53673e285 (diff)
refactor(api): extract Remuxer interface and move ffmpeg/MPEG-TS/mime logic to internal/probe
Move LooksLikeMPEGTS, MimeTypeForFilename and the ffmpeg remux path out of the api transport layer into a new internal/probe/remux.go package. This removes os/exec and mime tables from the api layer, satisfying the DIP principle. - New probe.Remuxer interface with FFRemuxer implementation - Server depends on probe.Remuxer, injected via NewServer - Updated cmd/mediaplayer wiring and all test helpers - All tests pass: go test ./... -race -cover
Diffstat (limited to 'cmd/mediaplayer/main.go')
-rw-r--r--cmd/mediaplayer/main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/mediaplayer/main.go b/cmd/mediaplayer/main.go
index f7c5928..7ecf052 100644
--- a/cmd/mediaplayer/main.go
+++ b/cmd/mediaplayer/main.go
@@ -96,7 +96,8 @@ func runWithSignal(args []string, sigCh <-chan os.Signal) error {
defer gcWorker.Stop()
staticFS := http.Dir("web")
- server := api.NewServer(store, hasher, sm, cfg, mediaSvc, adminSvc, progressSvc, authSvc, staticFS)
+ remuxer := probe.NewFFRemuxer()
+ server := api.NewServer(store, hasher, sm, cfg, mediaSvc, adminSvc, progressSvc, authSvc, staticFS, remuxer)
gs := api.NewGracefulServer(server, cfg)