From b1c1ab6694c9aa8bda5248a3a8042226eb46c6a1 Mon Sep 17 00:00:00 2001 From: elsholz Date: Mon, 15 Jan 2024 23:20:58 +0100 Subject: [PATCH] fix bug --- api/code/metroplanner_api/v1/endpoints/_plans.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/code/metroplanner_api/v1/endpoints/_plans.py b/api/code/metroplanner_api/v1/endpoints/_plans.py index 12aa6ff..d922545 100644 --- a/api/code/metroplanner_api/v1/endpoints/_plans.py +++ b/api/code/metroplanner_api/v1/endpoints/_plans.py @@ -299,16 +299,16 @@ def get_plan( print("found shortlink stats:", shortlink_stats) views = shortlink_stats["views"] - print('Views:', views) per_hour, per_day, per_month = [], [], [] now = datetime.now() + day_aggregate = 0 + month_aggregate = 0 + for hour in range(24 * 360): time_to_get = now - timedelta(hours=-hour) time_to_hour = time_to_get.isoformat().split(":")[0] - day_aggregate = 0 - month_aggregate = 0 ts = int(time_to_get.timestamp()) v = views.get(time_to_hour, 0)