This commit is contained in:
mike
2026-06-27 20:23:14 +02:00
parent 35306327f7
commit 52ae51fef3
7 changed files with 4493 additions and 134 deletions

View File

@@ -174,6 +174,21 @@ def set_archived(filename, archived: bool):
cur.close()
_put_db_connection(conn)
def set_filenames_archived(filenames, archived: bool):
if not filenames:
return []
conn = get_db_connection()
cur = conn.cursor()
try:
cur.execute("UPDATE person SET archived = %s WHERE filename = ANY(%s) RETURNING filename", (archived, list(filenames)))
rows = cur.fetchall()
updated = [r[0] for r in rows]
conn.commit()
return updated
finally:
cur.close()
_put_db_connection(conn)
def set_hidden(filename, hidden: bool):
conn = get_db_connection()
cur = conn.cursor()