From acc41a09f5fb86211597bcc8a1040deb1e029fbc Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Tue, 11 Aug 2015 18:49:00 +0300 Subject: [PATCH] downloads fix --- functions.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/functions.py b/functions.py index d534fa4..b6c6c36 100644 --- a/functions.py +++ b/functions.py @@ -1540,10 +1540,16 @@ class DownloadDB: self.db.commit() self.cur.close() except: - self.cur.execute('drop table downloads') - first = True - self.db.commit() - self.cur.close() + try: + self.cur.execute('drop table downloads') + first = True + self.db.commit() + self.cur.close() + except: + self.db.close() + os.remove(self.filename) + first = True + self.db = sqlite.connect(self.filename, check_same_thread=False) if first: cur = self.db.cursor()