Change alsa source name for discovery API

This commit is contained in:
Alex X
2025-03-28 13:26:52 +03:00
parent 1b41f61247
commit 5666943559

View File

@@ -47,10 +47,13 @@ func apiAlsa(w http.ResponseWriter, r *http.Request) {
r1, r2 := dev.RangeRates()
c1, c2 := dev.RangeChannels()
source := &api.Source{
Name: info.ID + " / " + info.Name + " / " + info.SubName,
Name: info.ID,
Info: fmt.Sprintf("Formats: %s, Rates: %d-%d, Channels: %d-%d", formats, r1, r2, c1, c2),
URL: "alsa:device?audio=" + path,
}
if !strings.Contains(source.Name, info.Name) {
source.Name += ", " + info.Name
}
sources = append(sources, source)
}