This commit is contained in:
DiMartinoXBMC committed 2015-07-04 19:11:18 +03:00
1 parent 730d1bf492
commit f464681cde
2 files changed
+792 -742

No files matched your search

+778 -738
View File
File diff suppressed because it is too large. Load diff
+14 -4
View File
@@ -28,6 +28,7 @@ import os
import json import json
import urllib import urllib
import hashlib import hashlib
import shutil
import xbmcplugin import xbmcplugin
import xbmcgui import xbmcgui
@@ -1586,10 +1587,19 @@ class DownloadDB:
def _execute(self, sql): def _execute(self, sql):
try: try:
self.cur.execute(sql) self.cur.execute(sql)
except: except Exception, e:
self._close() if str(e)=='no such table: downloads':
Debug('[DownloadDB]: DELETE ' + str(self.filename)) cur = self.db.cursor()
xbmcvfs.delete(self.filename) cur.execute('pragma auto_vacuum=1')
cur.execute(
'create table downloads(addtime integer PRIMARY KEY, title varchar(32), path varchar(32), type varchar(32), jsoninfo varchar(32), status varchar(32), torrent varchar(32), ind integer, lastupdate integer, storage varchar(32))')
self.db.commit()
cur.close()
self.cur = self.db.cursor()
else:
self._close()
Debug('[DownloadDB]: DELETE ' + str(self.filename))
xbmcvfs.delete(self.filename)
self._connect() self._connect()
self.cur.execute(sql) self.cur.execute(sql)