From af29461e3a21de9b4aafbc741c5b8b0af36d1ced Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 30 Apr 2026 11:38:21 +0300 Subject: 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. --- cmd/mediaplayer/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cmd/mediaplayer/main.go') 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") -- cgit v1.2.3