refactor/match_collector: refactor platform handling logic

This commit is contained in:
2026-04-23 18:08:17 +02:00
parent a5728a147f
commit 360be86c10
4 changed files with 140 additions and 83 deletions

View File

@@ -11,6 +11,7 @@ import {
areTreeSimilars,
treeDeriveTags
} from './item_tree'
import { PLATFORM_KEYS } from './platform'
import { Match, Timeline, Participant, Frame } from './api'
@@ -345,10 +346,10 @@ function handleMatch(match: Match, champions: Map<number, ChampionData>, platfor
// Track region distribution for this lane
if (lane.regionDistribution && platform) {
const platformKey = platform.toLowerCase()
if (platformKey === 'euw1') lane.regionDistribution.euw++
else if (platformKey === 'eun1') lane.regionDistribution.eun++
else if (platformKey === 'na1') lane.regionDistribution.na++
else if (platformKey === 'kr') lane.regionDistribution.kr++
const regionKey = PLATFORM_KEYS[platformKey]
if (regionKey) {
lane.regionDistribution[regionKey]!++
}
}
// Initialize matchups if not present