frozenpandaman / s3s

Successor to splatnet2statink. Takes battle data from the SplatNet 3 app and uploads it to stat.ink!
https://github.com/frozenpandaman/s3s/wiki
GNU General Public License v3.0
403 stars 72 forks source link

Fix sending rank/series info with -M #54

Closed Toufool closed 1 year ago

frozenpandaman commented 2 years ago

Thanks @Toufool! If you call fetch_json() with specific=True, though, it makes 3 queries (and more when League and X Battles are added) every time it checks for new results which is not ideal – can't we just call LatestBattleHistoriesQuery? That's just 1 query, and all our recent battles should be within that query. However, that does make sense that since BankaraBattleHistoriesQuery is not getting called, rank info also won't get sent. Can we make it so that if a ranked result is detected then it does that query for more info (namely, getting the rank letter)?

Toufool commented 2 years ago

@frozenpandaman I made a change, I still need to test it when I'm home though so don't merge yet. Essentially if we're in monitoring mode we can just use LatestBattleHistoriesQuery in prepare_battle_result and theoretically it should be able to find the correct id, match up to the battle["id"] passed in, and send the rank info.

Toufool commented 2 years ago

I couldn't find a good way to do this, so I reverted back to the other solution. That specific bankara query has more information in it than latest battles does, and I'm going to guess that x rank and league will be the same. It's unfortunate that the "battle id's" between LatestBattleHistoriesQuery and BankaraBattleHistoriesQuery are different :(

feel free to reject this tho if u dont want to use this solution