From 7c991bc4e3ca3a559b31ae76572eae96c25d2b57 Mon Sep 17 00:00:00 2001 From: bbedward Date: Mon, 4 May 2026 12:09:49 -0400 Subject: [PATCH] bluetooth: fix codec parsing names --- quickshell/Modules/Plugins/BasePill.qml | 2 +- quickshell/Services/BluetoothService.qml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/quickshell/Modules/Plugins/BasePill.qml b/quickshell/Modules/Plugins/BasePill.qml index 7dea95a3..48d15ad2 100644 --- a/quickshell/Modules/Plugins/BasePill.qml +++ b/quickshell/Modules/Plugins/BasePill.qml @@ -172,7 +172,7 @@ Item { } property bool _blurRegistered: false - readonly property bool _shouldBlur: BlurService.enabled && blurBarWindow && blurBarWindow.registerBlurWidget && !(barConfig?.noBackground ?? false) && root.visible && root.width > 0 + readonly property bool _shouldBlur: BlurService.enabled && !!blurBarWindow && !!blurBarWindow.registerBlurWidget && !(barConfig?.noBackground ?? false) && root.visible && root.width > 0 on_ShouldBlurChanged: _updateBlurRegistration() diff --git a/quickshell/Services/BluetoothService.qml b/quickshell/Services/BluetoothService.qml index a8caa8b1..774a5337 100644 --- a/quickshell/Services/BluetoothService.qml +++ b/quickshell/Services/BluetoothService.qml @@ -228,7 +228,7 @@ Singleton { } function getCodecInfo(codecName) { - const codec = codecName.replace(/-/g, "_").toUpperCase(); + const codec = codecName.replace(/[-\s]+/g, "_").toUpperCase(); const codecMap = { "LDAC": { @@ -406,8 +406,8 @@ Singleton { if (parts.length >= 2) { let profile = parts[0].trim(); let description = parts[1]; - let codecMatch = description.match(/codec ([^\)\s]+)/i); - let codecName = codecMatch ? codecMatch[1].toUpperCase() : "UNKNOWN"; + let codecMatch = description.match(/codec ([^\)]+)\)/i); + let codecName = codecMatch ? codecMatch[1].trim().toUpperCase() : "UNKNOWN"; let codecInfo = root.getCodecInfo(codecName); if (codecInfo && !codecQueryProcess.availableCodecs.some(c => { return c.profile === profile; @@ -480,8 +480,8 @@ Singleton { if (parts.length >= 2) { let profile = parts[0].trim(); let description = parts[1]; - let codecMatch = description.match(/codec ([^\)\s]+)/i); - let codecName = codecMatch ? codecMatch[1].toUpperCase() : "UNKNOWN"; + let codecMatch = description.match(/codec ([^\)]+)\)/i); + let codecName = codecMatch ? codecMatch[1].trim().toUpperCase() : "UNKNOWN"; let codecInfo = root.getCodecInfo(codecName); if (codecInfo && !codecFullQueryProcess.availableCodecs.some(c => { return c.profile === profile;