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.
This commit is contained in:
Chuddah 2020-02-18 21:02:47 +00:00
commit ea73d0fcf7

View file

@ -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)