1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-05 12:02:06 -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

@@ -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;