@@ -994,31 +994,32 @@ class GameTab
994994 if (buf.find (" grayscale" ) != std::string::npos)
995995 continue ;
996996
997- if (buf.find (" /perk/" ) != std::string::npos)
997+ if (buf.find (" /perkStyle/" ) != std::string::npos)
998+ {
999+ buf = buf.substr (buf.find (" /perkStyle/" ) + strlen (" /perkStyle/" ), 4 );
1000+ if (primaryPerk.empty ())
1001+ primaryPerk = buf;
1002+ else if (secondaryPerk.empty ())
1003+ secondaryPerk = buf;
1004+ }
1005+ else if (buf.find (" /perk/" ) != std::string::npos)
9981006 {
9991007 buf = buf.substr (buf.find (" /perk/" ) + strlen (" /perk/" ), 4 );
1000- std::cout << buf << std::endl;
10011008 runes.emplace_back (buf);
1002-
1003- if (primaryPerk.empty ())
1004- primaryPerk = buf.substr (0 , 2 ) + " 00" ;
1005- else if (secondaryPerk.empty () && buf.substr (0 , 2 ) != primaryPerk.substr (0 , 2 ))
1006- secondaryPerk = buf.substr (0 , 2 ) + " 00" ;
10071009 }
10081010 else if (buf.find (" /perkShard/" ) != std::string::npos)
10091011 {
10101012 buf = buf.substr (buf.find (" /perkShard/" ) + strlen (" /perkShard/" ), 4 );
1011- std::cout << buf << std::endl;
10121013 runes.emplace_back (buf);
10131014 }
10141015 }
10151016 }
1016- if (runes.size () != 9 )
1017+ if (runes.size () != 9 || primaryPerk. empty () || secondaryPerk. empty () )
10171018 {
10181019 return " Failed to fetch op.gg runes" ;
10191020 }
10201021
1021- LCU::Request (" DELETE" , " /lol-perks/v1/page /" + currentPageId);
1022+ LCU::Request (" DELETE" , " /lol-perks/v1/pages /" + currentPageId);
10221023
10231024 Json::Value rootPage;
10241025 rootPage[" name" ] = currentChampionName + " OP.GG" ;
0 commit comments