api_version.py 599 B

123456789101112131415161718
  1. from .tool.func import *
  2. async def api_version(version_list):
  3. with get_db_connect() as conn:
  4. curs = conn.cursor()
  5. curs.execute(db_change('select data from other where name = "update"'))
  6. up_data = curs.fetchall()
  7. up_data = up_data[0][0] if up_data and up_data[0][0] in ['stable', 'beta', 'dev'] else 'stable'
  8. json_data = {
  9. "version" : version_list['r_ver'],
  10. "db_version" : version_list['c_ver'],
  11. "skin_version" : version_list['s_ver'],
  12. "build" : up_data
  13. }
  14. return flask.jsonify(json_data)