From f89d5c96f617226703286f1287559cfe5f3bcfa7 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Tue, 19 Jul 2016 02:08:35 -0500 Subject: [PATCH] Transform database locked into a settings Temporary settings, because it slows down the process since it's auto-committing. Not everyone has database locked crashes. Permanent fix is being worked on in the database branch. --- resources/language/English/strings.xml | 1 + resources/lib/utils.py | 5 ++++- resources/settings.xml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index 189d6856..1f626dd9 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -228,6 +228,7 @@ Emby Connect Server Username or email + Enable database locked fix (will slow syncing process) Sign in with Emby Connect diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 8623f3c4..079c9514 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -97,7 +97,10 @@ def kodiSQL(media_type="video"): else: dbPath = getKodiVideoDBPath() - connection = sqlite3.connect(dbPath, isolation_level=None, timeout=20) + if settings('dblock') == "true": + connection = sqlite3.connect(dbPath, isolation_level=None, timeout=20) + else: + connection = sqlite3.connect(dbPath, timeout=20) return connection def getKodiVideoDBPath(): diff --git a/resources/settings.xml b/resources/settings.xml index 5a25f3b1..91006dbb 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -25,6 +25,7 @@ +