From ea73d0fcf77ab081a50cd297ff9dbe869cea6935 Mon Sep 17 00:00:00 2001 From: Chuddah Date: Tue, 18 Feb 2020 21:02:47 +0000 Subject: [PATCH] Prepare for a new install and the table not existing. When loading the cache the table may not exist for the initial user. In this case set the local cache to be empty. The table will be created shortly. --- jellyfin_kodi/objects/kodi/kodi.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jellyfin_kodi/objects/kodi/kodi.py b/jellyfin_kodi/objects/kodi/kodi.py index 86da88f7..dd613089 100644 --- a/jellyfin_kodi/objects/kodi/kodi.py +++ b/jellyfin_kodi/objects/kodi/kodi.py @@ -22,8 +22,13 @@ class Kodi(object): def __init__(self): self.artwork = artwork.Artwork(self.cursor) - self.cursor.execute(QU.get_all_people) - self._people_cache = dict(self.cursor.fetchall()) + try: + self.cursor.execute(QU.get_all_people) + except: + # Failed to load the table. Has the table been created? + self._people_cache = {} + else: + self._people_cache = dict(self.cursor.fetchall()) def create_entry_path(self): self.cursor.execute(QU.create_path)