Change response sources API

This commit is contained in:
Alexey Khit
2023-09-01 22:27:33 +03:00
parent 22787b979d
commit 0621b82aff
14 changed files with 29 additions and 29 deletions
+2 -2
View File
@@ -111,11 +111,11 @@ func apiHandle(w http.ResponseWriter, r *http.Request) {
}
} else {
// response all shares
var items []api.Source
var items []*api.Source
for src, share := range shares {
pwd := srv.GetSharePwd(share)
source := fmt.Sprintf("webtorrent:?share=%s&pwd=%s", share, pwd)
items = append(items, api.Source{ID: src, URL: source})
items = append(items, &api.Source{ID: src, URL: source})
}
api.ResponseSources(w, items)
}