Don't do episode checks on first run
This commit is contained in:
parent
c8125399c9
commit
86e7a9622e
1 changed files with 23 additions and 19 deletions
|
@ -448,25 +448,29 @@ class LibrarySync():
|
||||||
#we have to compare the lists somehow
|
#we have to compare the lists somehow
|
||||||
# TODO --> instead of matching by season and episode number we can use the uniqueid
|
# TODO --> instead of matching by season and episode number we can use the uniqueid
|
||||||
for item in episodeData:
|
for item in episodeData:
|
||||||
comparestring1 = str(item.get("ParentIndexNumber")) + "-" + str(item.get("IndexNumber"))
|
if(installFirstRun):
|
||||||
matchFound = False
|
progressAction = "Adding"
|
||||||
if kodiEpisodes != None:
|
WriteKodiDB().addEpisodeToKodiLibrary(item)
|
||||||
KodiItem = kodiEpisodes.get(comparestring1, None)
|
else:
|
||||||
if(KodiItem != None):
|
comparestring1 = str(item.get("ParentIndexNumber")) + "-" + str(item.get("IndexNumber"))
|
||||||
matchFound = True
|
matchFound = False
|
||||||
|
if kodiEpisodes != None:
|
||||||
progressAction = "Checking"
|
KodiItem = kodiEpisodes.get(comparestring1, None)
|
||||||
if not matchFound:
|
if(KodiItem != None):
|
||||||
#double check the item it might me added delayed by the Kodi scanner
|
matchFound = True
|
||||||
if ReadKodiDB().getKodiEpisodeByMbItem(item["Id"],tvshow) == None:
|
|
||||||
#no match so we have to create it
|
progressAction = "Checking"
|
||||||
WriteKodiDB().addEpisodeToKodiLibrary(item)
|
if not matchFound:
|
||||||
progressAction = "Adding"
|
#double check the item it might me added delayed by the Kodi scanner
|
||||||
totalItemsAdded += 1
|
if ReadKodiDB().getKodiEpisodeByMbItem(item["Id"],tvshow) == None:
|
||||||
|
#no match so we have to create it
|
||||||
if(self.ShouldStop(pDialog)):
|
WriteKodiDB().addEpisodeToKodiLibrary(item)
|
||||||
return False
|
progressAction = "Adding"
|
||||||
|
totalItemsAdded += 1
|
||||||
|
|
||||||
|
if(self.ShouldStop(pDialog)):
|
||||||
|
return False
|
||||||
|
|
||||||
# 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))
|
||||||
|
|
Loading…
Reference in a new issue