Remove tokens from downloaded database

This commit is contained in:
JonnyWong16 2022-01-15 16:13:53 -08:00
parent 6742ce613a
commit ce0cdf9ce6
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 19 additions and 8 deletions

View file

@ -332,10 +332,11 @@ def optimize_db():
optimize()
def db_filename(filename=FILENAME):
def db_filename(filename=None):
""" Returns the filepath to the db """
return os.path.join(plexpy.DATA_DIR, filename)
if filename is None:
return os.path.join(plexpy.DATA_DIR, FILENAME)
return filename
def make_backup(cleanup=False, scheduler=False):
@ -404,9 +405,9 @@ def dict_factory(cursor, row):
class MonitorDatabase(object):
def __init__(self, filename=FILENAME):
self.filename = filename
self.connection = sqlite3.connect(db_filename(filename), timeout=20)
def __init__(self, filename=None):
self.filename = db_filename(filename)
self.connection = sqlite3.connect(self.filename, timeout=20)
# Set database synchronous mode (default NORMAL)
self.connection.execute("PRAGMA synchronous = %s" % plexpy.CONFIG.SYNCHRONOUS_MODE)
# Set database journal mode (default WAL)