update
This commit is contained in:
@@ -125,12 +125,23 @@ def drop_missing(conn, keep_ids):
|
||||
return len(gone)
|
||||
|
||||
|
||||
# Ein Film bringt im Schnitt vierzehn Bildpfade mit, einer sogar 179.
|
||||
# Die Karte zeigt vier. Der Rest kommt beim Öffnen über /api/movies/{id}.
|
||||
KATALOG_BILDER = 6
|
||||
|
||||
|
||||
def all_movies():
|
||||
with connect() as conn:
|
||||
rows = conn.execute(
|
||||
"SELECT * FROM movies ORDER BY vote_count DESC, title ASC"
|
||||
).fetchall()
|
||||
return [row_to_dict(r) for r in rows]
|
||||
filme = []
|
||||
for row in rows:
|
||||
film = row_to_dict(row)
|
||||
if film.get("images"):
|
||||
film["images"] = film["images"][:KATALOG_BILDER]
|
||||
filme.append(film)
|
||||
return filme
|
||||
|
||||
|
||||
def get_movie(movie_id):
|
||||
|
||||
Reference in New Issue
Block a user