mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 08:36:13 +00:00
style: fix majority of remaining wsl_v5 whitespace issues
- Add missing whitespace above range loops, if statements, and assignments - Fix whitespace in models package (navigation, serviceavailability, supportedurls) - Improve whitespace in test files and examples - Fix whitespace in client package methods - Maintain code functionality while improving readability Reduced wsl_v5 issues from 29 to 27.
This commit is contained in:
@@ -395,6 +395,7 @@ func (c *Client) RemovePreset(id int) error {
|
||||
}
|
||||
|
||||
preset := &models.Preset{ID: id}
|
||||
|
||||
err := c.post("/removePreset", preset)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to remove preset %d: %w", id, err)
|
||||
|
||||
@@ -17,6 +17,7 @@ func ExampleClient_Navigate() {
|
||||
}
|
||||
|
||||
fmt.Printf("Found %d items in TuneIn\n", response.TotalItems)
|
||||
|
||||
for _, item := range response.Items {
|
||||
fmt.Printf("- %s (%s)\n", item.GetDisplayName(), item.Type)
|
||||
}
|
||||
@@ -200,7 +201,8 @@ func Example_searchAndPlayWorkflow() {
|
||||
}
|
||||
|
||||
// 2. Show available stations
|
||||
fmt.Printf("Found %d stations:\n", len(stations))
|
||||
fmt.Printf("Found %d stations\n", len(stations))
|
||||
|
||||
for i, station := range stations[:minInt(5, len(stations))] {
|
||||
fmt.Printf("%d. %s", i+1, station.GetDisplayName())
|
||||
if station.Description != "" {
|
||||
|
||||
@@ -23,8 +23,10 @@ func TestClient_Navigation_Integration(t *testing.T) {
|
||||
var finalHost string
|
||||
|
||||
var finalPort int
|
||||
|
||||
if strings.Contains(host, ":") {
|
||||
parts := strings.Split(host, ":")
|
||||
|
||||
finalHost = parts[0]
|
||||
if len(parts) > 1 {
|
||||
// Use default port if parsing fails
|
||||
@@ -156,8 +158,10 @@ func TestClient_StationManagement_Integration(t *testing.T) {
|
||||
var finalHost string
|
||||
|
||||
var finalPort int
|
||||
|
||||
if strings.Contains(host, ":") {
|
||||
parts := strings.Split(host, ":")
|
||||
|
||||
finalHost = parts[0]
|
||||
if len(parts) > 1 {
|
||||
finalPort = 8090
|
||||
@@ -184,6 +188,7 @@ func TestClient_StationManagement_Integration(t *testing.T) {
|
||||
}
|
||||
|
||||
var pandoraAccount string
|
||||
|
||||
for _, source := range sources.SourceItem {
|
||||
if source.Source == "PANDORA" && source.Status.IsReady() {
|
||||
pandoraAccount = source.SourceAccount
|
||||
@@ -314,6 +319,7 @@ func TestClient_Navigation_ErrorHandling_Integration(t *testing.T) {
|
||||
|
||||
// Parse host:port if provided
|
||||
var finalHost string
|
||||
|
||||
var finalPort int
|
||||
if strings.Contains(host, ":") {
|
||||
parts := strings.Split(host, ":")
|
||||
@@ -390,6 +396,7 @@ func BenchmarkClient_Navigate_Integration(b *testing.B) {
|
||||
|
||||
// Parse host:port if provided
|
||||
var finalHost string
|
||||
|
||||
var finalPort int
|
||||
if strings.Contains(host, ":") {
|
||||
parts := strings.Split(host, ":")
|
||||
|
||||
@@ -630,7 +630,6 @@ func TestClient_GetStoredMusicLibrary(t *testing.T) {
|
||||
}
|
||||
client := NewClient(config)
|
||||
client.baseURL = server.URL
|
||||
|
||||
response, err := client.GetStoredMusicLibrary("device123/0")
|
||||
|
||||
if err != nil {
|
||||
@@ -764,7 +763,6 @@ func TestClient_SearchStation(t *testing.T) {
|
||||
}
|
||||
client := NewClient(config)
|
||||
client.baseURL = server.URL
|
||||
|
||||
response, err := client.SearchStation(tt.source, tt.sourceAccount, tt.searchTerm)
|
||||
|
||||
if tt.expectError {
|
||||
@@ -874,7 +872,6 @@ func TestClient_SearchTuneInStations(t *testing.T) {
|
||||
}
|
||||
client := NewClient(config)
|
||||
client.baseURL = server.URL
|
||||
|
||||
response, err := client.SearchTuneInStations("Jazz")
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -72,6 +72,7 @@ func TestGetServiceAvailability_Integration(t *testing.T) {
|
||||
|
||||
localServices := serviceAvailability.GetLocalServices()
|
||||
t.Logf("Local services count: %d", len(localServices))
|
||||
|
||||
for _, service := range localServices {
|
||||
t.Logf(" - Local: %s (%v)", service.Type, service.IsAvailable)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user