another fix

This commit is contained in:
Marcel van der Veldt 2015-03-25 13:31:19 +01:00
parent a513c01707
commit 2cab251517

View file

@ -433,33 +433,33 @@ class LibrarySync():
total = len(episodeData) + 1 total = len(episodeData) + 1
count = 0 count = 0
#we have to compare the lists somehow #we have to compare the lists somehow
for item in episodeData: for item in episodeData:
comparestring1 = str(item.get("ParentIndexNumber")) + "-" + str(item.get("IndexNumber")) comparestring1 = str(item.get("ParentIndexNumber")) + "-" + str(item.get("IndexNumber"))
matchFound = False matchFound = False
if kodiEpisodes != None: if kodiEpisodes != None:
KodiItem = kodiEpisodes.get(comparestring1, None) KodiItem = kodiEpisodes.get(comparestring1, None)
if(KodiItem != None): if(KodiItem != None):
matchFound = True matchFound = True
progressAction = "Checking" progressAction = "Checking"
if not matchFound: if not matchFound:
#no match so we have to create it #no match so we have to create it
WriteKodiDB().addEpisodeToKodiLibrary(item) WriteKodiDB().addEpisodeToKodiLibrary(item)
updateNeeded = True updateNeeded = True
progressAction = "Adding" progressAction = "Adding"
totalItemsAdded += 1 totalItemsAdded += 1
if(self.ShouldStop(pDialog)): if(self.ShouldStop(pDialog)):
return True return True
# update progress bar # update progress bar
if(pDialog != None): if(pDialog != None):
percentage = int(((float(count) / float(total)) * 100)) percentage = int(((float(count) / float(total)) * 100))
pDialog.update(percentage, progressTitle, progressAction + " Episode: " + str(count)) pDialog.update(percentage, progressTitle, progressAction + " Episode: " + str(count))
count += 1 count += 1
showCurrent += 1 showCurrent += 1
#initiate library update and wait for finish before processing any updates #initiate library update and wait for finish before processing any updates
if updateNeeded: if updateNeeded: