summaryrefslogtreecommitdiff
path: root/internal/api/handlers_podcast.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-09 11:11:49 +0300
committerPaul Buetow <paul@buetow.org>2026-05-09 11:11:49 +0300
commit8c32cd117abe79f4ee6cff3a950ffc35c95faeff (patch)
tree5b63a4789351da4f2d9c1cd2e7007f67d43b3371 /internal/api/handlers_podcast.go
parent59c8870061465142306e7a6e5d3fcb344686cfe9 (diff)
Refine media browsing and set covers
Diffstat (limited to 'internal/api/handlers_podcast.go')
-rw-r--r--internal/api/handlers_podcast.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/internal/api/handlers_podcast.go b/internal/api/handlers_podcast.go
index f93b15c..721e83e 100644
--- a/internal/api/handlers_podcast.go
+++ b/internal/api/handlers_podcast.go
@@ -13,25 +13,17 @@ import (
// ------------------------------------------------------------------
func (s *Server) handleListPodcasts(w http.ResponseWriter, r *http.Request) {
- if !requireService(w, s.browseSvc) {
+ if !requireService(w, s.podcastSvc) {
return
}
- userID := userIDFromContext(r)
- sets, err := s.browseSvc.ListSets(r.Context(), userID)
+ feeds, err := s.podcastSvc.ListFeeds(r.Context(), userIDFromContext(r))
if err != nil {
s.logger.Error("list podcasts", "err", err)
writeJSON(w, http.StatusInternalServerError, map[string]string{"error": "failed to list podcasts"})
return
}
- // Filter to podcast sets only.
- var podcasts []interface{}
- for _, set := range sets {
- if set.IsPodcast {
- podcasts = append(podcasts, set)
- }
- }
- writeJSON(w, http.StatusOK, podcasts)
+ writeJSON(w, http.StatusOK, feeds)
}
func (s *Server) handleSubscribePodcast(w http.ResponseWriter, r *http.Request) {