поправлен маппинг с отсортированными элементами в инпутах
This commit is contained in:
@@ -1338,16 +1338,10 @@
|
||||
}
|
||||
|
||||
function mappingInventoryInputs(profile) {
|
||||
const inputs = Array.isArray(profile?.inventory?.inputs) ? [...profile.inventory.inputs] : [];
|
||||
const numberValue = (item) => {
|
||||
const match = String(item?.number ?? "").match(/\d+/);
|
||||
return match ? Number(match[0]) : Number.MAX_SAFE_INTEGER;
|
||||
};
|
||||
return inputs.sort((a, b) => {
|
||||
const diff = numberValue(a) - numberValue(b);
|
||||
if (diff) return diff;
|
||||
return String(a?.title || a?.key || "").localeCompare(String(b?.title || b?.key || ""), "ru", { numeric: true, sensitivity: "base" });
|
||||
});
|
||||
// Preserve the exact Input sequence received from the vMix API via Agent.
|
||||
// The array order is presentation-only: stable Mapping identity still uses
|
||||
// key -> unique title -> number, so changing Input positions does not break links.
|
||||
return Array.isArray(profile?.inventory?.inputs) ? [...profile.inventory.inputs] : [];
|
||||
}
|
||||
|
||||
function mappingInputByKey(profile, key, title = "") {
|
||||
|
||||
Reference in New Issue
Block a user