This commit is contained in:
2026-08-23 14:13:18 -05:00
parent 789bf91eed
commit 866f243f1b
37 changed files with 1761 additions and 58 deletions
+22
View File
@@ -34,3 +34,25 @@ func (h *Web) handlePodcastDownload(w http.ResponseWriter, r *http.Request) {
go func() { _ = h.Podcasts.DownloadEpisode(context.Background(), id) }()
http.Redirect(w, r, "/podcasts", http.StatusFound)
}
func (h *Web) handlePodcastDownloadAll(w http.ResponseWriter, r *http.Request) {
id := r.PathValue("id")
if _, err := database.GetPodcastChannel(h.DB, id); err != nil {
http.NotFound(w, r)
return
}
if err := r.ParseForm(); err != nil {
http.Error(w, "bad request", http.StatusBadRequest)
return
}
go func() {
if err := h.Podcasts.DownloadChannel(context.Background(), id); err != nil && h.Log != nil {
h.Log.Warn("podcast channel download failed", "channel", id, "err", err)
}
}()
destination := "/podcasts"
if next := r.FormValue("next"); next != "" {
destination = safeRedirectPath(next)
}
http.Redirect(w, r, destination, http.StatusFound)
}