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:
@@ -257,7 +257,16 @@ function build(rows, ids){
|
|||||||
for(const rec of rows){
|
for(const rec of rows){
|
||||||
const u = rec.user||{};
|
const u = rec.user||{};
|
||||||
const uid = rec.userId||u.id;
|
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));
|
kept.sort((a,b)=> Number(b.ITCPoints||0)-Number(a.ITCPoints||0));
|
||||||
return {kept, matchedCount:matched.size};
|
return {kept, matchedCount:matched.size};
|
||||||
|
|||||||
Reference in New Issue
Block a user