more fancy solution for the episode adds where show doesn't exist yet

This commit is contained in:
Marcel van der Veldt 2015-05-12 21:27:27 +02:00
parent 025fd31da8
commit da4b99f989
2 changed files with 12 additions and 12 deletions

View file

@ -70,9 +70,8 @@ class LibrarySync():
cursor = connection.cursor()
#Add the special emby table
if not startupDone:
cursor.execute("CREATE TABLE IF NOT EXISTS emby(emby_id TEXT, kodi_id INTEGER, media_type TEXT, checksum TEXT, parent_id INTEGER)")
connection.commit()
cursor.execute("CREATE TABLE IF NOT EXISTS emby(emby_id TEXT, kodi_id INTEGER, media_type TEXT, checksum TEXT, parent_id INTEGER)")
connection.commit()
# sync movies
self.MoviesFullSync(connection,cursor,pDialog)
@ -99,9 +98,8 @@ class LibrarySync():
cursor = connection.cursor()
#Add the special emby table
if not startupDone:
cursor.execute("CREATE TABLE IF NOT EXISTS emby(emby_id TEXT, kodi_id INTEGER, media_type TEXT, checksum TEXT, parent_id INTEGER)")
connection.commit()
cursor.execute("CREATE TABLE IF NOT EXISTS emby(emby_id TEXT, kodi_id INTEGER, media_type TEXT, checksum TEXT, parent_id INTEGER)")
connection.commit()
self.MusicFullSync(connection,cursor,pDialog)
cursor.close()
@ -575,6 +573,12 @@ class LibrarySync():
if kodi_show_id:
WriteKodiVideoDB().addOrUpdateEpisodeToKodiLibrary(MBitem["Id"], kodi_show_id, connection, cursor)
else:
#tv show doesn't exist
#perform full tvshow sync instead so both the show and episodes get added
self.TvShowsFullSync(connection,cursor,None)
return
#### PROCESS MUSICVIDEOS ####
allEmbyMusicvideos = ReadEmbyDB().getMusicVideos(itemList)

View file

@ -163,12 +163,8 @@ class WebSocketThread(threading.Thread):
self.logMsg("Message : WebSocket LibraryChanged : Items Updated : " + str(itemsUpdated), 0)
self.logMsg("Message : WebSocket LibraryChanged : Items Removed : " + str(itemsRemoved), 0)
if itemsAdded:
self.logMsg("Message : Doing Full LibrarySync")
LibrarySync().FullLibrarySync()
else:
self.remove_items(itemsRemoved)
self.update_items(itemsToUpdate)
self.remove_items(itemsRemoved)
self.update_items(itemsToUpdate)
elif messageType == "GeneralCommand":