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.
This commit is contained in:
angelblue05 2016-07-19 02:08:35 -05:00
parent c1632ec27a
commit f89d5c96f6
3 changed files with 6 additions and 1 deletions

View file

@ -228,6 +228,7 @@
<string id="30541">Emby Connect</string>
<string id="30542">Server</string>
<string id="30543">Username or email</string>
<string id="30544">Enable database locked fix (will slow syncing process)</string>
<!-- dialogs -->
<string id="30600">Sign in with Emby Connect</string>

View file

@ -97,7 +97,10 @@ def kodiSQL(media_type="video"):
else:
dbPath = getKodiVideoDBPath()
if settings('dblock') == "true":
connection = sqlite3.connect(dbPath, isolation_level=None, timeout=20)
else:
connection = sqlite3.connect(dbPath, timeout=20)
return connection
def getKodiVideoDBPath():

View file

@ -25,6 +25,7 @@
</category>
<category label="30506"><!-- Sync Options -->
<setting id="dblock" type="bool" label="30544" default="false" />
<setting id="serverSync" type="bool" label="30514" default="true" />
<setting id="incSyncIndicator" label="30507" type="number" default="10" visible="eq(-1,true)" subsetting="true"/>
<setting id="limitindex" type="number" label="30515" default="200" option="int" />