Skip to content

Commit

Permalink
fix songid parse in requestchartleaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jul 17, 2018
1 parent ab16fb1 commit fe4a4c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DownloadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,10 +880,13 @@ void DownloadManager::RequestChartLeaderBoard(string chartkey)
auto j = json::parse(req.result);
if (j.find("errors") != j.end())
throw exception();
//msg.SetParam("songid", RString(j.value("songid", "").c_str())); // want songid here or something -mina
auto scores = j.find("data");
for (auto scoreJ : (*scores)) {
auto score = *(scoreJ.find("attributes"));

// i don't really want to do this very iteration but oh well -mina
msg.SetParam("songid", RString(score.value("songId", "").c_str()));

OnlineScore tmp;
auto user = *(score.find("user"));
tmp.username = user.value("userName", "").c_str();
Expand Down

0 comments on commit fe4a4c1

Please sign in to comment.