-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Hello guys,
I've recently switched from GioF71/librespot-docker to go-librespot. I'm missing the "AP-PORT" config.
apresolve/resolve.go asks https://apresolve.spotify.com/ for aps - spotify answers with a json, that always puts Urls with Port "4070" first. This means when this port is not working on the network you have to wait for the connection to timeout before it tries contacting an Url with port 80 or 443.
A config variable setting the preferred AP-Port and then filtering or resorting the apresolve answer would help heaps!
Im not experienced in Go, vibecoding suggested adding a func:
func filterPort(addrs []string, port string) []string { var filtered []string for _, addr := range addrs { if _, p, err := net.SplitHostPort(addr); err == nil && p != port { filtered = append(filtered, addr) } } if len(filtered) == 0 { return addrs } return filtered }
and replacing the r.endpoints like that: "r.endpoints[endpointTypeAccesspoint] = filterPort(respJson.Accesspoint, "4070")"
But I'm pretty sure that not the best way
Would love if changing preferred Ap Port would get implemented once theres time for it. thank you so much!