diff --git a/app.py b/app.py index ce8e621..96f4f5a 100644 --- a/app.py +++ b/app.py @@ -51,6 +51,8 @@ def getShowtimes(date): "synopsis": movie.synopsis, "affiche": movie.affiche, "director": movie.director, + "wantToSee": movie.wantToSee, + "url": f"https://www.allocine.fr/film/fichefilm_gen_cfilm={movie.id}.html", "seances": {} } @@ -60,6 +62,10 @@ def getShowtimes(date): data[movie.title]["seances"][theater.name].append(showtime.startsAt.strftime("%H:%M")) + data = data.values() + + data = sorted(data, key=lambda x: x["wantToSee"], reverse=True) + return data showtimes = [] diff --git a/templates/index.html b/templates/index.html index 2b0c395..050ffb5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -43,13 +43,13 @@
- {% for film in films.values() %} + {% for film in films %}
-

{{film.title}}

+

{{film.title}}

Réalisateur : {{film.director}}

Casting : {{ film.casting }}