Merge pull request #7783 from omacom/fix/issue-6952

Keep PwNode objects out of the audio panel's Repeater models
This commit is contained in:
Omarchybot authored and GitHub committed 2026-10-04 02:33:47 +02:00
commit 5c4da02146
3 files changed
+76 -24

No files matched your search

+11
View File
@@ -13,6 +13,17 @@ assert(!audio.isPlaybackStream({ isStream: false, isSink: true }), 'audio reject
assert(audio.isAudioSource({ audio: {} }), 'audio detects nodes with audio as sources')
assert(audio.isAudioSource({ type: 'Audio/Source' }), 'audio detects typed source nodes')
// A destroyed PwNode stays truthy but reads back no id, which is the shape the
// third entry stands in for: it must not reach a Repeater row. The first carries
// an object like a live node's audio, so a row that is the node itself fails here.
assertDeepEqual(
audio.rowSnapshot([{ id: 0, name: 'alsa_output', audio: { volume: 1 } }, { id: 42 }, {}, null]),
[{ id: 0, name: 'alsa_output' }, { id: 42, name: '' }],
'audio projects nodes to primitive rows and drops nodes without an id'
)
assertDeepEqual(audio.rowSnapshot(undefined), [], 'audio projects a missing list to no rows')
assert(audio.nodeRow({ id: 7, name: 'bluez_output' }).name === 'bluez_output', 'audio rows carry the node name that identifies them')
assertEqual(audio.outputVolumeName(0, false), 'Silenced', 'audio labels silent output')
assertEqual(audio.outputVolumeName(0.9, false), 'Party mode', 'audio labels loud output')
assertEqual(audio.outputVolumeName(0.5, true), 'Muted', 'audio labels muted output')