Compare commits

...

2 Commits

Author SHA1 Message Date
bartholin
71c05404af Merge branch 'main' of lain.church:bartholin/flask-server 2024-10-13 16:19:56 +02:00
bartholin
c411befcf5 fix bug where movies did not show up properly 2024-10-13 16:19:17 +02:00

View File

@ -78,7 +78,7 @@ def get_watched_movies():
def new_movie(movie): def new_movie(movie):
db = get_db() db = get_db()
movie["id"] = db.execute("INSERT INTO movies (title, year, poster, plot, number) VALUES (?,?,?,?,?) RETURNING id", movie["id"] = db.execute("INSERT INTO movies (title, year, poster, plot, number, watched) VALUES (?,?,?,?,?, 0) RETURNING id",
(movie["title"], movie["year"], movie["poster"], movie["plot"], new_nb())).fetchone()["id"] (movie["title"], movie["year"], movie["poster"], movie["plot"], new_nb())).fetchone()["id"]
db.commit() db.commit()
return movie return movie