mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 08:36:13 +00:00
initializeDefaultSources() called GetDefaultSources(), which includes the legacy INTERNET_RADIO stub (ID 10002). On every service start it would re-add that entry to any device whose Sources.xml had it removed — including devices where the stale_internet_radio health-check quick fix was applied — silently undoing the clean-up. getAccountSources() in marge.go had the same issue: it passed the full default list into the /full cloud response, causing a phantom "sources_xml_diff" Info finding after a clean-up. Fix: export the existing private getInitialSources() as GetInitialSources() (excludes INTERNET_RADIO) and use it in both call sites instead of GetDefaultSources(). Existing devices that still have INTERNET_RADIO in their Sources.xml are unaffected: the merge loop only appends entries that are missing, so a present entry is preserved (the token is refreshed as before). Update unit and integration test expectations accordingly: the no-device fallback now returns 3 cloud sources (LOCAL_INTERNET_RADIO, TUNEIN, RADIO_BROWSER) instead of 4 (dropping INTERNET_RADIO / ID 10002). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
68 lines
3.7 KiB
HTTP
68 lines
3.7 KiB
HTTP
### GET /streaming/account/{{accountId}}/full
|
|
GET {{host}}/streaming/account/{{accountId}}/full
|
|
User-Agent: Bose_Lisa/27.0.6
|
|
Accept: application/vnd.bose.streaming-v1.2+xml
|
|
Authorization: Bearer {{token}}
|
|
|
|
> {%
|
|
client.test("Request executed successfully", function() {
|
|
client.assert(response.status === 200, "Response status is not 200");
|
|
});
|
|
|
|
client.test("Response content-type is correct", function() {
|
|
var type = response.contentType.mimeType;
|
|
client.assert(type === "application/vnd.bose.streaming-v1.2+xml", "Expected 'application/vnd.bose.streaming-v1.2+xml' but received '" + type + "'");
|
|
});
|
|
|
|
client.test("Response body structure", function() {
|
|
var account = response.body.getElementsByTagName("account")[0];
|
|
client.assert(account !== null, "Missing 'account' root element");
|
|
// We use accountId from environment variables
|
|
var expectedAccountId = client.variables.environment.get("accountId");
|
|
client.assert(account.getAttribute("id") === expectedAccountId, "Expected account id '" + expectedAccountId + "' but received '" + account.getAttribute("id") + "'");
|
|
|
|
var accountStatus = account.getElementsByTagName("accountStatus")[0];
|
|
client.assert(accountStatus.textContent === "OK", "Account status is not OK");
|
|
|
|
var devices = account.getElementsByTagName("devices")[0];
|
|
client.assert(devices !== null, "Missing 'devices' element");
|
|
|
|
var deviceList = devices.getElementsByTagName("device");
|
|
client.assert(deviceList.length > 0, "No 'device' elements found");
|
|
|
|
var firstDevice = deviceList[0];
|
|
client.assert(firstDevice.getAttribute("deviceid").length > 0, "Missing deviceid attribute");
|
|
|
|
var attachedProduct = firstDevice.getElementsByTagName("attachedProduct")[0];
|
|
client.assert(attachedProduct !== null, "Missing 'attachedProduct'");
|
|
client.assert(attachedProduct.getAttribute("product_code").length > 0, "Missing product_code");
|
|
|
|
var presets = firstDevice.getElementsByTagName("presets")[0];
|
|
client.assert(presets !== undefined, "Missing 'presets' element");
|
|
|
|
var recents = firstDevice.getElementsByTagName("recents")[0];
|
|
client.assert(recents !== undefined, "Missing 'recents' element");
|
|
|
|
var sources = account.getElementsByTagName("sources")[0];
|
|
client.assert(sources !== null, "Missing 'sources' element");
|
|
var sourceCount = sources.getElementsByTagName("source").length;
|
|
client.assert(sourceCount > 0, "No 'source' elements found in account sources");
|
|
// AUX (sourceproviderid=9) is intentionally excluded from cloud-side
|
|
// /full responses — real Bose never emitted it; the speaker enumerates
|
|
// AUX from its own hardware via isLocal=true in :8090/sources. See
|
|
// pkg/service/marge/marge.go getAccountSources for the reasoning and
|
|
// commit 2b40481 for the fix that closed #195/#269.
|
|
// INTERNET_RADIO (id=10002) is also excluded — it is a legacy stub
|
|
// that AfterTouch no longer adds to new or existing devices. See
|
|
// GetInitialSources() in pkg/service/datastore/datastore.go.
|
|
client.assert(sourceCount === 4, "Expected 4 cloud sources (LOCAL_INTERNET_RADIO, TUNEIN, RADIO_BROWSER, Spotify; AUX and INTERNET_RADIO are excluded) but got " + sourceCount);
|
|
|
|
// Explicit negative assertion: AUX must not appear in /full.
|
|
var sourceList = sources.getElementsByTagName("source");
|
|
for (var i = 0; i < sourceList.length; i++) {
|
|
var pid = sourceList[i].getElementsByTagName("sourceproviderid")[0];
|
|
client.assert(!pid || pid.textContent !== "9", "/full must not include AUX (sourceproviderid=9)");
|
|
}
|
|
});
|
|
%}
|