Run through pyfa.io for update checks (allows us to log version usage and provide more flexibility going forward). Falls back to simple github request

This commit is contained in:
blitzmann
2018-05-07 22:55:35 -04:00
parent 5101e2851a
commit c1322a3566

View File

@@ -48,7 +48,11 @@ class CheckUpdateThread(threading.Thread):
network = Network.getInstance()
try:
response = network.request('https://api.github.com/repos/pyfa-org/Pyfa/releases', network.UPDATE)
try:
response = network.request('https://www.pyfa.io/update_check?pyfa_version={}'.format(config.version), network.UPDATE)
except Exception as e:
response = network.request('https://api.github.com/repos/pyfa-org/Pyfa/releases', network.UPDATE)
jsonResponse = response.json()
jsonResponse.sort(
key=lambda x: calendar.timegm(dateutil.parser.parse(x['published_at']).utctimetuple()),