filter: only include placings where team is set to Gateway Gamers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 22:13:35 -05:00
co-authored by Claude Sonnet 4.6
parent 85493614e8
commit f9d098beb3
+10 -1
View File
@@ -257,7 +257,16 @@ function build(rows, ids){
for(const rec of rows){
const u = rec.user||{};
const uid = rec.userId||u.id;
if(uid && ids.has(uid)){ kept.push(rec); matched.add(uid); }
if(!uid || !ids.has(uid)) continue;
// If the placing record carries team info, only keep entries where the
// player was registered under Gateway Gamers for that result.
const recTeamId = rec.teamId || (rec.team && rec.team.id);
const recTeamName = rec.teamName || (rec.team && rec.team.name)||"";
if(recTeamId && recTeamId !== CONFIG.teamId) continue;
if(!recTeamId && recTeamName && !recTeamName.toLowerCase().includes("gateway gamers")) continue;
kept.push(rec); matched.add(uid);
}
kept.sort((a,b)=> Number(b.ITCPoints||0)-Number(a.ITCPoints||0));
return {kept, matchedCount:matched.size};