From 866412a720bdb0c27a5d6de7cb116ff2d6b656b2 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 9 Dec 2018 14:00:26 +0100 Subject: [PATCH] Catch error if Kodi DB cannot be used in WAL mode --- resources/lib/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index ee1640e9..681d81d7 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -403,7 +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;') + try: + conn.execute('PRAGMA journal_mode=WAL;') + except IOError: + LOG.warn('PKC could NOT activate sqlite WAL mode, sync might be slow') conn.execute('PRAGMA synchronous=NORMAL;') # Use transactions conn.execute('BEGIN')