You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/utils.py

17 lines
567 B

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()