|
@@ -1683,9 +1683,7 @@ ${JSON.stringify(_list)}
|
|
|
console.log("👇转译结果👇");
|
|
|
console.log(privText);
|
|
|
console.log(privSpeakerId);
|
|
|
- console.log(privDuration);
|
|
|
- console.log(privOffset);
|
|
|
- if (!privText && !privSpeakerId) {
|
|
|
+ if (!privText || !privSpeakerId || privSpeakerId=='Unknown') {
|
|
|
console.log(privText, privSpeakerId);
|
|
|
console.log(!privText || !privSpeakerId);
|
|
|
return;
|
|
@@ -1695,14 +1693,13 @@ ${JSON.stringify(_list)}
|
|
|
privSpeakerId = _roleList[privSpeakerId];
|
|
|
} else {
|
|
|
_getRoleList.push({
|
|
|
- index: textList.length,
|
|
|
role: privSpeakerId,
|
|
|
content: privText
|
|
|
});
|
|
|
- console.log(_getRoleList);
|
|
|
}
|
|
|
|
|
|
- console.log(_getRoleList.length >= 5 && !_getRoleLoading);
|
|
|
+ console.log("roleList",_roleList);
|
|
|
+ console.log("getRoleList",_getRoleList)
|
|
|
if (_getRoleList.length >= 5 && !_getRoleLoading) {
|
|
|
try {
|
|
|
let params = {
|
|
@@ -1723,24 +1720,23 @@ ${JSON.stringify(_list)}
|
|
|
.then(res => {
|
|
|
let _runData = res.data.data;
|
|
|
let _runResult = _runData.outputs.result;
|
|
|
+
|
|
|
_runResult.forEach((txt, index) => {
|
|
|
let _oldRole = _getRoleList[index].role;
|
|
|
if (!_roleList[_oldRole]) {
|
|
|
_roleList[_oldRole] = txt;
|
|
|
}
|
|
|
});
|
|
|
- // 去除内容
|
|
|
- _getRoleList.splice(0, _runResult.length);
|
|
|
- let _indexList = [];
|
|
|
- _getRoleList.forEach((i, index) => {
|
|
|
- if (_roleList[i.role]) {
|
|
|
- textList[i.index].role = _roleList[i.role];
|
|
|
- _indexList.push(index);
|
|
|
+ //已经有的role
|
|
|
+ let roleKeys = Object.keys(_roleList);
|
|
|
+
|
|
|
+ textList.forEach(i=>{
|
|
|
+ if(roleKeys.includes(i.role)){
|
|
|
+ i.role = _roleList[i.role]
|
|
|
}
|
|
|
- });
|
|
|
- _getRoleList = _getRoleList.filter(
|
|
|
- (item, index) => !_indexList.includes(index)
|
|
|
- );
|
|
|
+ })
|
|
|
+
|
|
|
+ _getRoleList = _getRoleList.filter(i=>!roleKeys.includes(i.role))
|
|
|
_getRoleLoading = false;
|
|
|
})
|
|
|
.catch(err => {
|