Web UI: podcasts, radio, shares, bookmarks pages; admin podcast/jukebox management; per-user Subsonic permission editor

This commit is contained in:
2026-08-23 00:34:58 -05:00
parent 2e222bd193
commit f1fdd8d2c2
21 changed files with 688 additions and 9 deletions
+42
View File
@@ -0,0 +1,42 @@
package web
import "net/http"
func (h *Web) handleAdminJukebox(w http.ResponseWriter, r *http.Request) {
data := struct {
Available bool
Status any
Error string
}{Available: h.Jukebox.Available}
if h.Jukebox.Available {
state, err := h.Jukebox.Status()
if err != nil {
data.Error = err.Error()
} else {
data.Status = state
}
}
h.page(w, r, "admin_jukebox", "admin_jukebox", "Jukebox", data)
}
func (h *Web) handleAdminJukeboxStop(w http.ResponseWriter, r *http.Request) {
if h.Jukebox.Available {
_, _ = h.Jukebox.Stop()
}
http.Redirect(w, r, "/admin/jukebox", http.StatusFound)
}
func (h *Web) handleAdminJukeboxStart(w http.ResponseWriter, r *http.Request) {
if h.Jukebox.Available {
_, _ = h.Jukebox.Start()
}
http.Redirect(w, r, "/admin/jukebox", http.StatusFound)
}
func (h *Web) handleAdminJukeboxClear(w http.ResponseWriter, r *http.Request) {
if h.Jukebox.Available {
_, _ = h.Jukebox.Clear()
}
http.Redirect(w, r, "/admin/jukebox", http.StatusFound)
}