From 8d9fb0046c5af215eca57e95c5752f6d8d95dc91 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 29 Oct 2026 18:22:09 -0400 Subject: [PATCH] refactor(podcasts): drop the dead downloadRoot param on upsertEpisode FilePath is library-relative (the pinned layout resolves at download time via the library folders); the parameter never carried a value. --- internal/services/podcast_service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/podcast_service.go b/internal/services/podcast_service.go index 0ac48179..506f1bd3 100644 --- a/internal/services/podcast_service.go +++ b/internal/services/podcast_service.go @@ -387,7 +387,7 @@ func (s *PodcastService) applyFetch(ctx context.Context, feed *database.PodcastF count := 0 for i := range parsed.Channel.Items { - if err := s.upsertEpisode(ctx, feed, root, feedSlug, &parsed.Channel.Items[i], i+1); err != nil { + if err := s.upsertEpisode(ctx, feed, feedSlug, &parsed.Channel.Items[i], i+1); err != nil { // One bad item must not sink the batch. log.Printf("[PODCAST] episode upsert failed for feed %s item %d: %v", feed.ID, i+1, err) continue @@ -418,8 +418,9 @@ func (s *PodcastService) applyFetch(ctx context.Context, feed *database.PodcastF // upsertEpisode maps one XML item onto a media_items row (plan §5 field // inventory). Positions are 1-based, renumbered per fetch; file_path is // the PLANNED final layout — the upsert only applies it to rows that -// are not yet downloaded (query-side guard). -func (s *PodcastService) upsertEpisode(ctx context.Context, feed *database.PodcastFeeds, downloadRoot, feedSlug string, item *PodcastItemXML, position int) error { +// are not yet downloaded (query-side guard); the abs root resolves at +// download time via the library folders. +func (s *PodcastService) upsertEpisode(ctx context.Context, feed *database.PodcastFeeds, feedSlug string, item *PodcastItemXML, position int) error { title := item.EpisodeTitle() if title == "" { title = fmt.Sprintf("Episode %d", position) @@ -477,7 +478,6 @@ func (s *PodcastService) upsertEpisode(ctx context.Context, feed *database.Podca Hosts: truncateSlice(hosts, 255), Guests: truncateSlice(guests, 255), }) - _ = downloadRoot // layout is relative; abs root resolves at download time return err }