more logging in blitzAPI

This commit is contained in:
mrbesen 2022-07-17 00:20:02 +02:00
parent c2203b4b5d
commit ece3d162e8
Signed by untrusted user: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 3 additions and 1 deletions

View File

@ -92,14 +92,16 @@ BlitzAPI::ChampionInfo BlitzAPI::getChampionInfo(uint32_t championID, Position p
const std::string variables = jvars.toJson().toStdString();
const std::string query = "query ChampionBuilds($championId:Int!,$queue:Queue!,$role:Role,$opponentChampionId:Int,$key:ChampionBuildKey){championBuildStats(championId:$championId,queue:$queue,role:$role,opponentChampionId:$opponentChampionId,key:$key){championId opponentChampionId queue role builds{completedItems{games index averageIndex itemId wins}games mythicId mythicAverageIndex primaryRune runes{games index runeId wins treeId}skillOrders{games skillOrder wins}startingItems{games startingItemIds wins}summonerSpells{games summonerSpellIds wins}wins}}}";
const std::string requeststr = "query=" + escape(query) + "&variables=" + escape(variables);
Log::debug << "GetChampionInfo requestVariables: " << variables;
QJsonDocument doc = request(requeststr);
if(!doc.isObject()) {
// error
Log::error << "could not get ChampionInfo. Returned Response: " << doc.toJson().toStdString();
return {};
}
// Log::info << "returned: " << doc.toJson().toStdString();
QJsonObject obj = doc.object();
QJsonValueRef dataref = obj["data"];