Add missing RADIO_BROWSER default source

This commit is contained in:
Tobias Gesellchen
2026-04-20 19:18:39 +02:00
parent 747a9cec97
commit 5e6885cfe8
4 changed files with 79 additions and 10 deletions
+12
View File
@@ -1503,6 +1503,18 @@ func (ds *DataStore) getDefaultSources() []models.ConfiguredSource {
CreatedOn: "2017-07-20T16:43:48.000+00:00",
UpdatedOn: "2017-07-20T16:43:48.000+00:00",
},
{
ID: "10005",
DisplayName: "",
SourceKeyType: constants.ProviderRadioBrowser,
SourceKeyAccount: "",
SourceProviderID: strconv.Itoa(constants.RadioBrowserProviderID),
Type: "Audio",
SecretType: "token",
Status: "READY",
CreatedOn: "2026-02-16T01:01:01.000+00:00",
UpdatedOn: "2026-02-16T01:01:01.000+00:00",
},
}
for i := range sources {
+2 -2
View File
@@ -65,8 +65,8 @@ func TestMargeCreateAccount(t *testing.T) {
}
// Verify it has default sources
if len(resp.Sources) != 4 {
t.Errorf("Expected 4 default sources, got %d", len(resp.Sources))
if len(resp.Sources) != 5 {
t.Errorf("Expected 5 default sources, got %d", len(resp.Sources))
} else {
if resp.Sources[0].ID != "10001" {
t.Errorf("Expected first source ID 10001, got %s", resp.Sources[0].ID)
+6 -1
View File
@@ -638,7 +638,7 @@ func TestDefaultSources(t *testing.T) {
t.Fatalf("Failed to get sources: %v", err)
}
expectedCount := 4
expectedCount := 5
if len(sources) != expectedCount {
t.Errorf("Expected %d sources, got %d", expectedCount, len(sources))
}
@@ -668,6 +668,11 @@ func TestDefaultSources(t *testing.T) {
if s.SecretType != "token" {
t.Errorf("Expected INTERNET_RADIO secretType token, got %s", s.SecretType)
}
case "RADIO_BROWSER":
foundIR = true
if s.SecretType != "token" {
t.Errorf("Expected RADIO_BROWSER secretType token, got %s", s.SecretType)
}
case "AUX":
foundAux = true
if s.DisplayName != "AUX IN" {