order by interest and add url

This commit is contained in:
Mathias DUPEUX 2024-09-18 20:32:49 +02:00
parent dfd629abd8
commit efaf0c8909
2 changed files with 8 additions and 2 deletions

6
app.py
View file

@ -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 = []

View file

@ -43,13 +43,13 @@
</div>
<div class="line"></div>
</div>
{% for film in films.values() %}
{% for film in films %}
<div class="container_infoFilm">
<img src={{ film.affiche }} class="affiche" />
<div class="infoFilm">
<div class="blur-background"></div>
<div>
<h3 class="titreFilm">{{film.title}}</h3>
<h3 class="titreFilm"><a href="{{ film.url }}">{{film.title}}</a></h3>
<div class="info-content">
<p class="realisateur">Réalisateur : {{film.director}}</p>
<p class="casting">Casting : {{ film.casting }}</p>