diff --git a/resources/lib/itemtypes/common.py b/resources/lib/itemtypes/common.py index 9c50a1e8..9390fbb0 100644 --- a/resources/lib/itemtypes/common.py +++ b/resources/lib/itemtypes/common.py @@ -72,7 +72,9 @@ class ItemBase(object): if exc_type: # re-raise any exception return False - self.commit() + self.plexconn.commit() + self.artconn.commit() + self.kodiconn.commit() self.plexconn.close() self.kodiconn.close() self.artconn.close() @@ -80,8 +82,11 @@ class ItemBase(object): def commit(self): self.plexconn.commit() + self.plexconn.execute('BEGIN') self.artconn.commit() + self.artconn.execute('BEGIN') self.kodiconn.commit() + self.kodiconn.execute('BEGIN') def set_fanart(self, artworks, kodi_id, kodi_type): """ diff --git a/resources/lib/utils.py b/resources/lib/utils.py index f9a18e2c..ee1640e9 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -403,10 +403,10 @@ def kodi_sql(media_type=None): else: db_path = v.DB_VIDEO_PATH conn = connect(db_path, timeout=5.0) - conn.execute('PRAGMA journal_mode=WAL') + conn.execute('PRAGMA journal_mode=WAL;') conn.execute('PRAGMA synchronous=NORMAL;') # Use transactions - conn.execute('BEGIN;') + conn.execute('BEGIN') return conn