diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-30 11:38:21 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-30 11:38:21 +0300 |
| commit | af29461e3a21de9b4aafbc741c5b8b0af36d1ced (patch) | |
| tree | 0a29d922a4816f8e1c928a02fd7e0b1ca9b96978 /cmd/mediaplayer/main.go | |
| parent | 100a9bb282dd4226368b4e5fac398726c7acf653 (diff) | |
task ea: wire filesystem scanner into app and admin rescan endpoint
- Add scanner.Scanner and mediaRoot fields to adminService.
- Update NewAdminService signature to accept scanner and mediaRoot.
- Implement TriggerRescan delegation to injected scanner.
- Wire probe.NewFFProber, thumb.NewFFmpegGenerator, and scanner.NewFSScanner
in cmd/mediaplayer/main.go.
- Add tests for TriggerRescan delegation, error propagation, and nil scanner.
Diffstat (limited to 'cmd/mediaplayer/main.go')
| -rw-r--r-- | cmd/mediaplayer/main.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/mediaplayer/main.go b/cmd/mediaplayer/main.go index fcc83e7..cb99869 100644 --- a/cmd/mediaplayer/main.go +++ b/cmd/mediaplayer/main.go @@ -15,8 +15,11 @@ import ( "codeberg.org/snonux/play/internal/api" "codeberg.org/snonux/play/internal/auth" "codeberg.org/snonux/play/internal/clock" + "codeberg.org/snonux/play/internal/probe" "codeberg.org/snonux/play/internal/repository" + "codeberg.org/snonux/play/internal/scanner" "codeberg.org/snonux/play/internal/service" + "codeberg.org/snonux/play/internal/thumb" ) func main() { @@ -48,7 +51,12 @@ func main() { sm := auth.NewSessionManager(store, clk, time.Duration(cfg.SessionTimeoutHours)*time.Hour) mediaSvc := service.NewMediaService(store, clk, cfg.MediaRoot) - adminSvc := service.NewAdminService(store, clk, hasher) + + prober := probe.NewFFProber() + thumbGen := thumb.NewFFmpegGenerator() + fsScanner := scanner.NewFSScanner(store, prober, thumbGen, clk, cfg.MediaRoot) + adminSvc := service.NewAdminService(store, clk, hasher, fsScanner, cfg.MediaRoot) + progressSvc := service.NewProgressService(store, clk) staticFS := http.Dir("web") |
