Merge pull request #36 from nbolton/no-timeout

fix: use background context directly without timeout
This commit is contained in:
Adriano Caloiaro 2025-11-18 06:43:22 -08:00 committed by GitHub
commit 40539d2a65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,9 +54,6 @@ var Networks = map[string]*components.Network{
},
}
// streamRequestTimeout is the timeout for requests to stream playlists (channels)
var streamRequestTimeout = 60 * time.Second
func GetNetwork(name string) (network *components.Network, err error) {
var ok bool
if network, ok = Networks[name]; !ok {
@ -225,8 +222,7 @@ func Stream(url string, ctx *context.AppContext) {
ctx.Player.Close()
}
rctx, cancel := c.WithTimeout(c.Background(), streamRequestTimeout)
defer cancel()
rctx := c.Background()
req, err := http.NewRequestWithContext(rctx, "GET", u, nil)
if err != nil {
ctx.SetStatusMessage("There was a problem streaming audio!")