perform all database commits at once instead of 1 by 1

This commit is contained in:
Marcel van der Veldt 2015-05-02 22:46:12 +02:00
parent e637af1b78
commit 383fb37ca3
3 changed files with 19 additions and 25 deletions

View file

@ -180,12 +180,13 @@ class WebSocketThread(threading.Thread):
self.update_items(itemsToUpdate)
def remove_items(self, itemsRemoved):
connection = utils.KodiSQL()
cursor = connection.cursor()
for item in itemsRemoved:
connection = utils.KodiSQL()
cursor = connection.cursor()
self.logMsg("Message : Doing LibraryChanged : Items Removed : Calling deleteEpisodeFromKodiLibraryByMbId: " + item, 0)
WriteKodiDB().deleteItemFromKodiLibrary(item, connection, cursor)
cursor.close()
connection.commit()
cursor.close()
def update_items(self, itemsToUpdate):
# doing adds and updates