From f464681cde8b571f0a5e163f15f0088973de0e02 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sat, 4 Jul 2015 19:11:18 +0300 Subject: [PATCH] fixes --- .idea/workspace.xml | 1516 ++++++++++++++++++++++--------------------- functions.py | 18 +- 2 files changed, 792 insertions(+), 742 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 63c9243..dc1b0df 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,11 +2,7 @@ - - - - - + @@ -17,6 +13,7 @@ + - + @@ -552,96 +579,6 @@ @@ -875,22 +902,22 @@ + - + - - + - + @@ -907,21 +934,9 @@ - - - - - - - - - - - - @@ -932,391 +947,52 @@ - - - + - - - + + - + - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1324,110 +1000,474 @@ - - - - - - - - - - + - - - + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/functions.py b/functions.py index 9d56909..a5b8eca 100644 --- a/functions.py +++ b/functions.py @@ -28,6 +28,7 @@ import os import json import urllib import hashlib +import shutil import xbmcplugin import xbmcgui @@ -1586,10 +1587,19 @@ class DownloadDB: def _execute(self, sql): try: self.cur.execute(sql) - except: - self._close() - Debug('[DownloadDB]: DELETE ' + str(self.filename)) - xbmcvfs.delete(self.filename) + except Exception, e: + if str(e)=='no such table: downloads': + cur = self.db.cursor() + 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.cur.execute(sql)