Streamd v0.2.0: rename, modules panel, stable/beta channels
All checks were successful
release / build-and-upload (push) Successful in 7m5s
All checks were successful
release / build-and-upload (push) Successful in 7m5s
- Rename product/host binary to streamd (drm compat copy still shipped) - Go module path streamd; STREAMD_* env aliases; agent UA streamd-agent - Panel Modules store + agent pull sync (modstore / modsync) - Rolling stable + beta download tags; README/docs channel curl blocks - Release notes in docs/releases/v0.2.0.md attached by Forgejo Actions
This commit is contained in:
parent
066e018749
commit
da8e1123ec
140 changed files with 2949 additions and 851 deletions
|
|
@ -3,10 +3,10 @@ package api
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"drmdecryption/apps/streamd/internal/auth"
|
||||
"drmdecryption/modhost"
|
||||
"drmdecryption/mpd"
|
||||
"drmdecryption/repo"
|
||||
"streamd/apps/streamd/internal/auth"
|
||||
"streamd/modhost"
|
||||
"streamd/mpd"
|
||||
"streamd/repo"
|
||||
)
|
||||
|
||||
// appInfo describes one modules/<name>/ provider to the dashboard, so the UI
|
||||
|
|
@ -16,6 +16,7 @@ type appInfo struct {
|
|||
Channels []channelInfo `json:"channels"`
|
||||
Rewriter string `json:"rewriter"`
|
||||
HasConfig bool `json:"has_config"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type channelInfo struct {
|
||||
|
|
@ -23,7 +24,9 @@ type channelInfo struct {
|
|||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
// apps answers GET /api/apps: which providers exist under modules/.
|
||||
// apps answers GET /api/apps: which providers exist under the panel modules store.
|
||||
// A single module that fails to describe is skipped with an error field rather
|
||||
// than failing the whole list (bad uploads must not blank the stream pickers).
|
||||
func (h *Handler) apps(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodGet {
|
||||
writeErr(w, http.StatusMethodNotAllowed, "method not allowed")
|
||||
|
|
@ -33,13 +36,27 @@ func (h *Handler) apps(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
out := []appInfo{}
|
||||
listed, err := modhost.ListAll(repo.Root())
|
||||
mods, err := modhost.Discover(repo.Root())
|
||||
if err != nil {
|
||||
writeErr(w, http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
for _, L := range listed {
|
||||
d := L.Desc
|
||||
for _, m := range mods {
|
||||
bin, err := modhost.EnsureBuilt(m)
|
||||
if err != nil {
|
||||
out = append(out, appInfo{Name: m.Name, Channels: []channelInfo{}, Rewriter: "none", Error: err.Error()})
|
||||
h.logger().Warn("module describe skipped", "module", m.Name, "err", err)
|
||||
continue
|
||||
}
|
||||
d, err := modhost.RunDescribe(bin)
|
||||
if err != nil {
|
||||
out = append(out, appInfo{Name: m.Name, Channels: []channelInfo{}, Rewriter: "none", Error: err.Error()})
|
||||
h.logger().Warn("module describe skipped", "module", m.Name, "err", err)
|
||||
continue
|
||||
}
|
||||
if d.Name == "" {
|
||||
d.Name = m.Name
|
||||
}
|
||||
info := appInfo{Name: d.Name, Channels: []channelInfo{}, Rewriter: "none"}
|
||||
for _, ch := range d.Channels {
|
||||
info.Channels = append(info.Channels, channelInfo{ID: ch.ID, Label: ch.Label})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue