1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-22 15:54:26 +00:00
bazarr/utils.py
2017-09-17 09:02:16 -04:00

16 lines
567 B
Python

import sqlite3
import time
def history_log(action, sonarrSeriesId, sonarrEpisodeId, description):
# Open database connection
db = sqlite3.connect('bazarr.db')
c = db.cursor()
# Get Sonarr API URL from database config table
history = c.execute('''INSERT INTO table_history(action, sonarrSeriesId, sonarrEpisodeId, timestamp, description) VALUES (?, ?, ?, ?, ?)''', (action, sonarrSeriesId, sonarrEpisodeId, time.time(), description))
# Commit changes to DB
db.commit()
# Close database connection
db.close()