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,24 +448,28 @@ 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:
|
||||||
|
KodiItem = kodiEpisodes.get(comparestring1, None)
|
||||||
|
if(KodiItem != None):
|
||||||
|
matchFound = True
|
||||||
|
|
||||||
progressAction = "Checking"
|
progressAction = "Checking"
|
||||||
if not matchFound:
|
if not matchFound:
|
||||||
#double check the item it might me added delayed by the Kodi scanner
|
#double check the item it might me added delayed by the Kodi scanner
|
||||||
if ReadKodiDB().getKodiEpisodeByMbItem(item["Id"],tvshow) == None:
|
if ReadKodiDB().getKodiEpisodeByMbItem(item["Id"],tvshow) == None:
|
||||||
#no match so we have to create it
|
#no match so we have to create it
|
||||||
WriteKodiDB().addEpisodeToKodiLibrary(item)
|
WriteKodiDB().addEpisodeToKodiLibrary(item)
|
||||||
progressAction = "Adding"
|
progressAction = "Adding"
|
||||||
totalItemsAdded += 1
|
totalItemsAdded += 1
|
||||||
|
|
||||||
if(self.ShouldStop(pDialog)):
|
if(self.ShouldStop(pDialog)):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# update progress bar
|
# update progress bar
|
||||||
if(pDialog != None):
|
if(pDialog != None):
|
||||||
|
|
Loading…
Reference in a new issue