Commit afe92752 authored by martin hou's avatar martin hou

feat: 增加模式识别

parent c9d57adf
...@@ -766,11 +766,18 @@ Jensen.prototype.listFiles = async function () { ...@@ -766,11 +766,18 @@ Jensen.prototype.listFiles = async function () {
} }
let ftime = fname.join(''); let ftime = fname.join('');
let duration = 0; let duration = 0;
if (ftime.match(/^\d{14}REC\d+\.wav$/gi)) { let mode = 'room';
ftime = ftime.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})REC.*$/gi, '$1-$2-$3 $4:$5:$6'); if (ftime.match(/^\d{14}(REC|WHSP|ROOM|CALL|WIP)\d+\.wav$/gi)) {
mode = ftime.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(REC|WHIP|ROOM|CALL|WIP).*$/gi, '$7').toLowerCase();
if (mode == 'REC') mode = 'room';
else if (mode == 'WHSP' || mode == 'WIP') mode = 'whisper';
else if (mode == 'ROOM') mode = 'room';
else if (mode == 'CALL') mode = 'call';
ftime = ftime.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(REC|WHIP|ROOM|CALL|WIP).*$/gi, '$1-$2-$3 $4:$5:$6');
ftime = new Date(ftime); ftime = new Date(ftime);
duration = flen / 32; duration = flen / 32;
} else if (ftime.match(/^(\d{2})?(\d{2})(\w{3})(\d{2})-(\d{2})(\d{2})(\d{2})-.*\.(hda|wav)$/gi)) { }
else if (ftime.match(/^(\d{2})?(\d{2})(\w{3})(\d{2})-(\d{2})(\d{2})(\d{2})-.*\.(hda|wav)$/gi)) {
// 2024Mar19-110932-Rec00.hda // 2024Mar19-110932-Rec00.hda
ftime = ftime.replace(/^(\d{2})?(\d{2})(\w{3})(\d{2})-(\d{2})(\d{2})(\d{2})-.*\.(hda|wav)$/gi, '20$2 $3 $4 $5:$6:$7'); ftime = ftime.replace(/^(\d{2})?(\d{2})(\w{3})(\d{2})-(\d{2})(\d{2})(\d{2})-.*\.(hda|wav)$/gi, '20$2 $3 $4 $5:$6:$7');
ftime = new Date(ftime); ftime = new Date(ftime);
...@@ -814,6 +821,7 @@ Jensen.prototype.listFiles = async function () { ...@@ -814,6 +821,7 @@ Jensen.prototype.listFiles = async function () {
duration: duration, duration: duration,
version: ver, version: ver,
length: flen, length: flen,
mode: mode,
signature: sign.join('') signature: sign.join('')
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment