From ce46fb701582a1467922018e25b656c0767ac9b9 Mon Sep 17 00:00:00 2001 From: shaun Date: Sun, 15 Jan 2017 10:46:14 +1100 Subject: [PATCH] on all emby DB connection create check the emby tables --- resources/lib/database.py | 22 ++++++++++------------ resources/lib/service_entry.py | 4 ---- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/resources/lib/database.py b/resources/lib/database.py index 8d92bdc7..c7d1097a 100644 --- a/resources/lib/database.py +++ b/resources/lib/database.py @@ -139,18 +139,16 @@ def verify_emby_database(cursor): # Create the tables for the emby database # emby, view, version - if window('emby_db_checked') != "true": - log.info("Verifying emby DB") - cursor.execute( - """CREATE TABLE IF NOT EXISTS emby( - emby_id TEXT UNIQUE, media_folder TEXT, emby_type TEXT, media_type TEXT, - kodi_id INTEGER, kodi_fileid INTEGER, kodi_pathid INTEGER, parent_id INTEGER, - checksum INTEGER)""") - cursor.execute( - """CREATE TABLE IF NOT EXISTS view( - view_id TEXT UNIQUE, view_name TEXT, media_type TEXT, kodi_tagid INTEGER)""") - cursor.execute("CREATE TABLE IF NOT EXISTS version(idVersion TEXT)") - window('emby_db_checked', value="true") + log.info("Verifying emby DB") + cursor.execute( + """CREATE TABLE IF NOT EXISTS emby( + emby_id TEXT UNIQUE, media_folder TEXT, emby_type TEXT, media_type TEXT, + kodi_id INTEGER, kodi_fileid INTEGER, kodi_pathid INTEGER, parent_id INTEGER, + checksum INTEGER)""") + cursor.execute( + """CREATE TABLE IF NOT EXISTS view( + view_id TEXT UNIQUE, view_name TEXT, media_type TEXT, kodi_tagid INTEGER)""") + cursor.execute("CREATE TABLE IF NOT EXISTS version(idVersion TEXT)") def db_reset(): diff --git a/resources/lib/service_entry.py b/resources/lib/service_entry.py index 8ef441d1..a41dd3fd 100644 --- a/resources/lib/service_entry.py +++ b/resources/lib/service_entry.py @@ -86,10 +86,6 @@ class Service(object): def service_entry_point(self): - # reset the internal emby tables check status - # we need to check at least once per run or on switching profiles - window('emby_db_checked', value="false") - # Important: Threads depending on abortRequest will not trigger # if profile switch happens more than once. self.monitor = kodimonitor.KodiMonitor()