1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-12 07:19:41 -04:00

bluetooth: fix codec parsing names

This commit is contained in:
bbedward
2026-05-04 12:09:49 -04:00
parent 50f0cbb122
commit 7c991bc4e3
2 changed files with 6 additions and 6 deletions

View File

@@ -172,7 +172,7 @@ Item {
} }
property bool _blurRegistered: false 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() on_ShouldBlurChanged: _updateBlurRegistration()

View File

@@ -228,7 +228,7 @@ Singleton {
} }
function getCodecInfo(codecName) { function getCodecInfo(codecName) {
const codec = codecName.replace(/-/g, "_").toUpperCase(); const codec = codecName.replace(/[-\s]+/g, "_").toUpperCase();
const codecMap = { const codecMap = {
"LDAC": { "LDAC": {
@@ -406,8 +406,8 @@ Singleton {
if (parts.length >= 2) { if (parts.length >= 2) {
let profile = parts[0].trim(); let profile = parts[0].trim();
let description = parts[1]; let description = parts[1];
let codecMatch = description.match(/codec ([^\)\s]+)/i); let codecMatch = description.match(/codec ([^\)]+)\)/i);
let codecName = codecMatch ? codecMatch[1].toUpperCase() : "UNKNOWN"; let codecName = codecMatch ? codecMatch[1].trim().toUpperCase() : "UNKNOWN";
let codecInfo = root.getCodecInfo(codecName); let codecInfo = root.getCodecInfo(codecName);
if (codecInfo && !codecQueryProcess.availableCodecs.some(c => { if (codecInfo && !codecQueryProcess.availableCodecs.some(c => {
return c.profile === profile; return c.profile === profile;
@@ -480,8 +480,8 @@ Singleton {
if (parts.length >= 2) { if (parts.length >= 2) {
let profile = parts[0].trim(); let profile = parts[0].trim();
let description = parts[1]; let description = parts[1];
let codecMatch = description.match(/codec ([^\)\s]+)/i); let codecMatch = description.match(/codec ([^\)]+)\)/i);
let codecName = codecMatch ? codecMatch[1].toUpperCase() : "UNKNOWN"; let codecName = codecMatch ? codecMatch[1].trim().toUpperCase() : "UNKNOWN";
let codecInfo = root.getCodecInfo(codecName); let codecInfo = root.getCodecInfo(codecName);
if (codecInfo && !codecFullQueryProcess.availableCodecs.some(c => { if (codecInfo && !codecFullQueryProcess.availableCodecs.some(c => {
return c.profile === profile; return c.profile === profile;