diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-10 08:31:03 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-10 08:31:03 +0300 |
| commit | aaabeded8ccf6e2326aa3836c10a9d81ed676f21 (patch) | |
| tree | 7cf3227c19534809d305e38164cc9821613d22cb /cmd | |
| parent | 23580049b785c61ee23ba0f56ffa37f85646101b (diff) | |
Decouple podcast browse logic from BrowseSet via PodcastBrowser interface
Extract PodcastBrowser interface and podcastBrowseService implementation
to move podcast-specific grid augmentation out of browseService.BrowseSet.
- Remove PodcastRepo from BrowseServiceStore and MediaServiceStore.
- browseService now delegates podcast set augmentation to an injected
PodcastBrowser strategy (kept optional/nil-safe).
- Add NewMediaServiceWithPodcastBrowser to wire a real PodcastBrowser
(backed by PodcastRepo) in production while keeping the plain
NewMediaService for existing callers/tests.
- Update main.go to instantiate NewPodcastBrowseService and inject it.
- Update browse_test.go to test PodcastBrowser-augmented paths through
the new constructor signature.
This keeps BrowseSet focused on files and folders only and removes the
podcast dependency from the browse contract.
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/player/main.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/player/main.go b/cmd/player/main.go index afc1a5e..02a9113 100644 --- a/cmd/player/main.go +++ b/cmd/player/main.go @@ -95,7 +95,10 @@ func wireDeps(cfg *internal.Config, store repository.Store, logger *slog.Logger, prober := probe.NewFFProber() thumbGen := thumb.NewFFmpegGenerator() - mediaSvc := service.NewMediaService(store, clk, cfg.MediaRoot, thumbGen, prober) + + helper := service.NewAccessHelper(store) + browser := service.NewPodcastBrowseService(store, cfg.MediaRoot) + mediaSvc := service.NewMediaServiceWithPodcastBrowser(store, clk, cfg.MediaRoot, thumbGen, prober, browser) fsScanner := scanner.NewFSScannerWithLogger(store, prober, thumbGen, clk, cfg.MediaRoot, logger) adminSvc := service.NewAdminServiceWithLogger(store, clk, hasher, fsScanner, cfg.MediaRoot, appCtx, logger) @@ -103,7 +106,6 @@ func wireDeps(cfg *internal.Config, store repository.Store, logger *slog.Logger, progressSvc := service.NewProgressService(store, clk) authSvc := service.NewAuthService(store, clk, hasher, sm) - helper := service.NewAccessHelper(store) podcastSvc := service.NewPodcastServiceWithLogger(store, clk, cfg.MediaRoot, helper, prober, thumbGen, &http.Client{Timeout: service.DefaultHTTPClientTimeout}, cfg.PodcastCheckMinutes, logger) gcWorker := service.NewGCWorker(store, clk, cfg.MediaRoot, time.Duration(cfg.GCIntervalMinutes)*time.Minute, logger) |
