record-daemon: fix summoner spells handling
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m22s

This commit is contained in:
2026-03-26 14:39:23 +01:00
parent 179678f95e
commit 506fc9827b

View File

@@ -403,14 +403,26 @@ impl Daemon {
});
// If we have puuid and session, extract player-specific data from session
let (champion, final_team, final_summoner_name) = if let Some(ref p) = puuid
{
let (champion, final_team, final_summoner_name, final_summoner_spells) =
if let Some(ref p) = puuid {
if let Some(ref sess) = session {
let champ_id = sess.get_champion_id(p);
let champ_name =
champ_id.and_then(record_daemon::lqp::champion_id_to_name);
let team_id = sess.get_team(p);
let summoner = sess.get_summoner_name(p).map(|s| s.to_string());
// Extract summoner spells from session's player_champion_selections
let spells_from_session =
sess.get_player_selection(p).map(|selection| {
record_daemon::lqp::SummonerSpells {
spell1_id: selection.spell1_id,
spell2_id: selection.spell2_id,
spell1_name: None,
spell2_name: None,
}
});
(
champ_name.or_else(|| {
champion_id
@@ -418,12 +430,15 @@ impl Daemon {
}),
team_id.or(team),
summoner.or(summoner_name),
spells_from_session.or(summoner_spells),
)
} else {
(
champion_id.and_then(record_daemon::lqp::champion_id_to_name),
champion_id
.and_then(record_daemon::lqp::champion_id_to_name),
team,
summoner_name,
summoner_spells,
)
}
} else {
@@ -431,12 +446,13 @@ impl Daemon {
champion_id.and_then(record_daemon::lqp::champion_id_to_name),
team,
summoner_name,
summoner_spells,
)
};
info!(
"[EVENT_HANDLER] Final values: puuid={:?}, runes={:?}, summoner_spells={:?}",
puuid, runes, summoner_spells
puuid, runes, final_summoner_spells
);
// Fetch all players identities for puuid mapping
@@ -464,7 +480,7 @@ impl Daemon {
summoner_name: final_summoner_name,
puuid,
runes,
summoner_spells,
summoner_spells: final_summoner_spells,
all_players: all_players_info,
..Default::default()
};