Skip to content

Commit

Permalink
重复弹幕判定条件去除用户名
Browse files Browse the repository at this point in the history
  • Loading branch information
Izumiko committed Jul 5, 2024
1 parent 2b665d7 commit d9bba73
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ede.js
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,11 @@
// 使用Map去重
const unique_cmts = [];
const cmtMap = new Map();
const removeUserRegex = /,[^,]+$/; //p: time,modeId,colorValue,user
all_cmts.forEach((comment) => {
if (!cmtMap.has(comment.p + comment.m)) {
cmtMap.set(comment.p + comment.m, true);
const p = comment.p.replace(removeUserRegex, '');
if (!cmtMap.has(p + comment.m)) {
cmtMap.set(p + comment.m, true);
unique_cmts.push(comment);
}
});
Expand Down

0 comments on commit d9bba73

Please sign in to comment.