mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 08:36:13 +00:00
code style: linting
This commit is contained in:
committed by
Tobias Gesellchen
parent
65b142881a
commit
44ad0e5928
@@ -20,6 +20,7 @@ func RadioBrowserSearch(query string) (*models.BmxNavResponse, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
|
||||
@@ -1049,10 +1049,12 @@ func (s *Server) handleDiscoveredDevice(d models.DiscoveredDevice) {
|
||||
if existing := s.findExistingDeviceInfoByDeviceID(deviceID); existing != nil {
|
||||
storedAccount = existing.AccountID
|
||||
}
|
||||
|
||||
accountID := liveInfo.MargeAccountUUID
|
||||
if accountID == "" {
|
||||
accountID = storedAccount
|
||||
}
|
||||
|
||||
if accountID == "" {
|
||||
accountID = "default"
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ func postSourcesUpdated(ds *datastore.DataStore, target Target) (string, error)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("post to speaker: %w", err)
|
||||
}
|
||||
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
if resp.StatusCode >= 300 {
|
||||
|
||||
@@ -132,6 +132,7 @@ func playDingOnDevice(ds *datastore.DataStore, serverURL string, target Target)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("post to speaker: %w", err)
|
||||
}
|
||||
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
if resp.StatusCode >= 300 {
|
||||
|
||||
@@ -63,6 +63,7 @@ func ProbeGet(ctx context.Context, rawURL string, timeout time.Duration) ProbeRe
|
||||
result.Err = err.Error()
|
||||
return result
|
||||
}
|
||||
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) // 1 MiB cap
|
||||
|
||||
Reference in New Issue
Block a user