remove some redundant code calls and do a shouldstop call in the add loop

This commit is contained in:
shaun 2015-04-05 09:59:15 +10:00
parent f2772ebdbd
commit 25286717b3
2 changed files with 15 additions and 9 deletions

View file

@ -74,6 +74,7 @@ class LibrarySync():
finally: finally:
WINDOW.setProperty("SyncDatabaseRunning", "false") WINDOW.setProperty("SyncDatabaseRunning", "false")
utils.logMsg("Sync DB", "syncDatabase Exiting", 0)
cursor.close() cursor.close()
return True return True
@ -448,6 +449,10 @@ class LibrarySync():
count = 0 count = 0
for item in episodeData: for item in episodeData:
if(self.ShouldStop(pDialog)):
return False
progressAction = "Adding" progressAction = "Adding"
WriteKodiDB().addEpisodeToKodiLibrary(item, connection, cursor) WriteKodiDB().addEpisodeToKodiLibrary(item, connection, cursor)

View file

@ -150,8 +150,8 @@ class WriteKodiDB():
port = addon.getSetting('port') port = addon.getSetting('port')
host = addon.getSetting('ipaddress') host = addon.getSetting('ipaddress')
server = host + ":" + port server = host + ":" + port
downloadUtils = DownloadUtils() #downloadUtils = DownloadUtils()
userid = downloadUtils.getUserId() #userid = downloadUtils.getUserId()
timeInfo = API().getTimeInfo(MBitem) timeInfo = API().getTimeInfo(MBitem)
userData=API().getUserData(MBitem) userData=API().getUserData(MBitem)
@ -354,8 +354,8 @@ class WriteKodiDB():
port = addon.getSetting('port') port = addon.getSetting('port')
host = addon.getSetting('ipaddress') host = addon.getSetting('ipaddress')
server = host + ":" + port server = host + ":" + port
downloadUtils = DownloadUtils() #downloadUtils = DownloadUtils()
userid = downloadUtils.getUserId() #userid = downloadUtils.getUserId()
timeInfo = API().getTimeInfo(MBitem) timeInfo = API().getTimeInfo(MBitem)
people = API().getPeople(MBitem) people = API().getPeople(MBitem)
@ -760,8 +760,8 @@ class WriteKodiDB():
port = addon.getSetting('port') port = addon.getSetting('port')
host = addon.getSetting('ipaddress') host = addon.getSetting('ipaddress')
server = host + ":" + port server = host + ":" + port
downloadUtils = DownloadUtils() #downloadUtils = DownloadUtils()
userid = downloadUtils.getUserId() #userid = downloadUtils.getUserId()
timeInfo = API().getTimeInfo(MBitem) timeInfo = API().getTimeInfo(MBitem)
userData=API().getUserData(MBitem) userData=API().getUserData(MBitem)
@ -986,8 +986,8 @@ class WriteKodiDB():
port = addon.getSetting('port') port = addon.getSetting('port')
host = addon.getSetting('ipaddress') host = addon.getSetting('ipaddress')
server = host + ":" + port server = host + ":" + port
downloadUtils = DownloadUtils() #downloadUtils = DownloadUtils()
userid = downloadUtils.getUserId() #userid = downloadUtils.getUserId()
timeInfo = API().getTimeInfo(MBitem) timeInfo = API().getTimeInfo(MBitem)
userData=API().getUserData(MBitem) userData=API().getUserData(MBitem)
@ -1353,3 +1353,4 @@ class WriteKodiDB():
kodiMovie = ReadKodiDB().getKodiMovie(boxsetmovie["Id"]) kodiMovie = ReadKodiDB().getKodiMovie(boxsetmovie["Id"])
if kodiMovie != None: if kodiMovie != None:
WriteKodiDB().updateProperty(kodiMovie,"set",strSet,"movie",True) WriteKodiDB().updateProperty(kodiMovie,"set",strSet,"movie",True)