Rename streams to sources in the discovery API

This commit is contained in:
Alexey Khit
2023-09-01 10:17:58 +03:00
parent 66c858e00e
commit 69da64a49c
16 changed files with 95 additions and 77 deletions
+5 -4
View File
@@ -2,11 +2,12 @@ package roborock
import (
"fmt"
"net/http"
"github.com/AlexxIT/go2rtc/internal/api"
"github.com/AlexxIT/go2rtc/internal/streams"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/roborock"
"net/http"
)
func Init() {
@@ -84,7 +85,7 @@ func apiHandle(w http.ResponseWriter, r *http.Request) {
return
}
var items []api.Stream
var items []api.Source
for _, device := range devices {
source := fmt.Sprintf(
@@ -93,8 +94,8 @@ func apiHandle(w http.ResponseWriter, r *http.Request) {
Auth.UserData.IoT.User, Auth.UserData.IoT.Pass, Auth.UserData.IoT.Domain,
device.DID, device.Key,
)
items = append(items, api.Stream{Name: device.Name, URL: source})
items = append(items, api.Source{Name: device.Name, URL: source})
}
api.ResponseStreams(w, items)
api.ResponseSources(w, items)
}