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.
This commit is contained in:
1 parent
5c10bbb90e
commit
8d9fb0046c
1 file changed
+4
-4
@@ -387,7 +387,7 @@ func (s *PodcastService) applyFetch(ctx context.Context, feed *database.PodcastF
|
|||||||
|
|
||||||
count := 0
|
count := 0
|
||||||
for i := range parsed.Channel.Items {
|
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.
|
// 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)
|
log.Printf("[PODCAST] episode upsert failed for feed %s item %d: %v", feed.ID, i+1, err)
|
||||||
continue
|
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
|
// upsertEpisode maps one XML item onto a media_items row (plan §5 field
|
||||||
// inventory). Positions are 1-based, renumbered per fetch; file_path is
|
// inventory). Positions are 1-based, renumbered per fetch; file_path is
|
||||||
// the PLANNED final layout — the upsert only applies it to rows that
|
// the PLANNED final layout — the upsert only applies it to rows that
|
||||||
// are not yet downloaded (query-side guard).
|
// are not yet downloaded (query-side guard); the abs root resolves at
|
||||||
func (s *PodcastService) upsertEpisode(ctx context.Context, feed *database.PodcastFeeds, downloadRoot, feedSlug string, item *PodcastItemXML, position int) error {
|
// 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()
|
title := item.EpisodeTitle()
|
||||||
if title == "" {
|
if title == "" {
|
||||||
title = fmt.Sprintf("Episode %d", position)
|
title = fmt.Sprintf("Episode %d", position)
|
||||||
@@ -477,7 +478,6 @@ func (s *PodcastService) upsertEpisode(ctx context.Context, feed *database.Podca
|
|||||||
Hosts: truncateSlice(hosts, 255),
|
Hosts: truncateSlice(hosts, 255),
|
||||||
Guests: truncateSlice(guests, 255),
|
Guests: truncateSlice(guests, 255),
|
||||||
})
|
})
|
||||||
_ = downloadRoot // layout is relative; abs root resolves at download time
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user