diff options
| author | Pinapelz <yukais@pinapelz.com> | 2023-11-19 10:26:15 -0800 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2023-11-19 10:26:15 -0800 |
| commit | ed391597a145ddcc32bb1e74610d4c9e9cad99d0 (patch) | |
| tree | 7c7d426c40452cfb12c00fa77a075d10485b0c55 | |
| parent | 15e1eeeb96efa730419c36e4e8cc639ecbbdf94b (diff) | |
fix day diff subtraction order
- I swear it was correct!?
| -rw-r--r-- | backend/app.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/app.py b/backend/app.py index 71ed62a..5ece4c7 100644 --- a/backend/app.py +++ b/backend/app.py @@ -20,7 +20,7 @@ def index(): def api_subscribers(): server = SQLHandler(CONFIG["SQL"]["host"], CONFIG["SQL"]["user"], CONFIG["SQL"]["password"], CONFIG["SQL"]["database"]) data = server.execute_query("SELECT * FROM subscriber_data INNER JOIN 24h_historical ON subscriber_data.channel_id = 24h_historical.channel_id ORDER BY subscriber_count DESC") - channel_data_list = [{"channel_name":row[3], "profile_pic": row[2], "subscribers": row[4], "sub_org": row[5], "video_count": row[6], "day_diff": int(row[10] - int(row[4]))} for row in data] + channel_data_list = [{"channel_name":row[3], "profile_pic": row[2], "subscribers": row[4], "sub_org": row[5], "video_count": row[6], "day_diff": int(row[4] - int(row[10]))} for row in data] subscriber_data = {"timestamp": datetime.datetime.now(),"channel_data":channel_data_list} return jsonify(subscriber_data) |
