refactor the downloadutils a little

move emby DB verify to the database class and run it for the first time an emby db con is created
refactor the play class playback started function a little
This commit is contained in:
shaun 2016-11-13 10:39:14 +11:00
commit 0cf8f07daf
6 changed files with 181 additions and 171 deletions

View file

@ -606,20 +606,6 @@ class LibrarySync(threading.Thread):
# Database out of date.
return False
def _verify_emby_database(self):
# Create the tables for the emby database
with database.DatabaseConn('emby') as cursor:
# emby, view, version
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 run(self):
try: