From ed391597a145ddcc32bb1e74610d4c9e9cad99d0 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 19 Nov 2023 10:26:15 -0800 Subject: fix day diff subtraction order - I swear it was correct!? --- backend/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/app.py') 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) -- cgit v1.2.3