Skip to content

Commit 5666943

Browse files
committed
Change alsa source name for discovery API
1 parent 1b41f61 commit 5666943

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/alsa/alsa_linux.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ func apiAlsa(w http.ResponseWriter, r *http.Request) {
4747
r1, r2 := dev.RangeRates()
4848
c1, c2 := dev.RangeChannels()
4949
source := &api.Source{
50-
Name: info.ID + " / " + info.Name + " / " + info.SubName,
50+
Name: info.ID,
5151
Info: fmt.Sprintf("Formats: %s, Rates: %d-%d, Channels: %d-%d", formats, r1, r2, c1, c2),
5252
URL: "alsa:device?audio=" + path,
5353
}
54+
if !strings.Contains(source.Name, info.Name) {
55+
source.Name += ", " + info.Name
56+
}
5457
sources = append(sources, source)
5558
}
5659

0 commit comments

Comments
 (0)