mirror of
https://github.com/simon987/od-database.git
synced 2025-12-13 14:59:02 +00:00
Searches are not saved to database
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user