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,7 +70,6 @@ class LibrarySync():
cursor = connection.cursor() cursor = connection.cursor()
#Add the special emby table #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)") cursor.execute("CREATE TABLE IF NOT EXISTS emby(emby_id TEXT, kodi_id INTEGER, media_type TEXT, checksum TEXT, parent_id INTEGER)")
connection.commit() connection.commit()
@ -99,7 +98,6 @@ class LibrarySync():
cursor = connection.cursor() cursor = connection.cursor()
#Add the special emby table #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)") cursor.execute("CREATE TABLE IF NOT EXISTS emby(emby_id TEXT, kodi_id INTEGER, media_type TEXT, checksum TEXT, parent_id INTEGER)")
connection.commit() connection.commit()
@ -575,6 +573,12 @@ class LibrarySync():
if kodi_show_id: if kodi_show_id:
WriteKodiVideoDB().addOrUpdateEpisodeToKodiLibrary(MBitem["Id"], kodi_show_id, connection, cursor) 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 #### #### PROCESS MUSICVIDEOS ####
allEmbyMusicvideos = ReadEmbyDB().getMusicVideos(itemList) allEmbyMusicvideos = ReadEmbyDB().getMusicVideos(itemList)

View file

@ -163,10 +163,6 @@ class WebSocketThread(threading.Thread):
self.logMsg("Message : WebSocket LibraryChanged : Items Updated : " + str(itemsUpdated), 0) self.logMsg("Message : WebSocket LibraryChanged : Items Updated : " + str(itemsUpdated), 0)
self.logMsg("Message : WebSocket LibraryChanged : Items Removed : " + str(itemsRemoved), 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.remove_items(itemsRemoved)
self.update_items(itemsToUpdate) self.update_items(itemsToUpdate)