From a0a5c688d3663628448fa8e9049c391c43ce92a2 Mon Sep 17 00:00:00 2001 From: MathiasDPX Date: Wed, 18 Sep 2024 18:55:11 +0200 Subject: [PATCH] fix showtimes --- app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index ed2558a..634ba82 100644 --- a/app.py +++ b/app.py @@ -62,8 +62,10 @@ def getShowtimes(date): return data -showtimes = getShowtimes(datetime.today()+timedelta(days=1)) -print("Séances récupéré!") +showtimes = [] +for i in range(0, 7): + print(f"Séances récupéré {i+1}/7!") + showtimes.append(getShowtimes(datetime.today()+timedelta(days=i))) app = Flask(__name__) @@ -114,7 +116,7 @@ def home(): "index": i }) - return render_template('index.html', page_actuelle='home', films=showtimes, dates=dates) + return render_template('index.html', page_actuelle='home', films=showtimes[delta], dates=dates) if __name__ == '__main__': app.run() \ No newline at end of file