Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/api/analyze/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ interface PlayerFullDataResponse {
playerDetails: Record<string, WCLPlayerDetails[]>;
};
};
// WCL report rankings blob β€” only `partition` is consumed (phase scoping)
rankings?: { data?: Array<{ fightID?: number; partition?: number }> };
damage?: { data: { entries: WCLDamageEntry[] } };
healing?: { data: { entries: WCLDamageEntry[] } };
buffs: { data: { auras: WCLBuffEntry[] } };
Expand Down Expand Up @@ -207,6 +209,13 @@ export async function POST(request: NextRequest) {
);
}

// Scope rankings to the report's own partition (raid phase). Without it,
// WCL falls back to the zone's default partition, which can compare an
// earlier-phase log against later-phase-geared top parses (inflated DPS).
const fightPartition = report.rankings?.data?.find(
(r) => r.fightID === fightId
)?.partition ?? report.rankings?.data?.[0]?.partition;

let rankingsData: WCLRankingsData;
try {
const rankingsResponse = await wclQuery<RankingsResponse>(
Expand All @@ -216,6 +225,7 @@ export async function POST(request: NextRequest) {
className: playerClass,
specName: playerSpec,
metric: playerRole === "healer" ? "hps" : "dps",
partition: typeof fightPartition === "number" ? fightPartition : null,
}
);
rankingsData = rankingsResponse.worldData.encounter.characterRankings;
Expand Down
2 changes: 2 additions & 0 deletions lib/wcl-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const PLAYER_FULL_DATA_QUERY_HEALING = `
reportData {
report(code: $code) {
playerDetails(fightIDs: $fightIDs)
rankings(fightIDs: $fightIDs)
healing: table(
dataType: Healing
fightIDs: $fightIDs
Expand Down Expand Up @@ -225,6 +226,7 @@ export const PLAYER_FULL_DATA_QUERY = `
reportData {
report(code: $code) {
playerDetails(fightIDs: $fightIDs)
rankings(fightIDs: $fightIDs)
damage: table(
dataType: DamageDone
fightIDs: $fightIDs
Expand Down
Loading