Searches are not saved to database

This commit is contained in:
Simon
2018-06-27 15:29:50 -04:00
parent 14037c5f21
commit 5383ad6aea
3 changed files with 57 additions and 48 deletions

View File

@@ -355,6 +355,15 @@ class Database:
return stats
def log_search(self, remote_addr, forwarded_for, q, exts, page):
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute("INSERT INTO SearchLogEntry (remote_addr, forwarded_for, query, extensions, page) VALUES "
"(?,?,?,?,?)", (remote_addr, forwarded_for, q, ",".join(exts), page))
conn.commit()