ming 3 éve
szülő
commit
ad4c996dd7
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      api/main.py

+ 2 - 2
api/main.py

@@ -130,8 +130,8 @@ def protected(request: Request, Authorize: AuthJWT = Depends()):
     Authorize.jwt_required()
     current_user = Authorize.get_jwt_subject()
     user_obj = first(db.query('SELECT * FROM users where username ="'+str(current_user)+'"'))
-    video_num = first(db.query('SELECT COUNT(*) FROM history_input WHERE user_id ='+str(user_obj['id'])))['COUNT(*)']
-    total_sec = first(db.query('SELECT SUM(duration) FROM history_input where user_id='+str(user_obj['id'])))['SUM(duration)']
+    video_num = str(first(db.query('SELECT COUNT(*) FROM history_input WHERE user_id ='+str(user_obj['id'])))['COUNT(*)'])
+    total_sec = str(first(db.query('SELECT SUM(duration) FROM history_input where user_id='+str(user_obj['id'])))['SUM(duration)'])
     left_sec = user_obj['left_time']
 
     video_info_list = []