optimise getting kodi movie and kodi episode

This commit is contained in:
im85288 2015-03-19 18:39:38 +00:00
parent 371672d56f
commit 310b647727

View file

@ -630,7 +630,7 @@ class LibrarySync():
#process movie #process movie
if type=='Movie': if type=='Movie':
MB3Movie = ReadEmbyDB().getItem(itemID) MB3Movie = ReadEmbyDB().getItem(itemID)
allKodiMovies = ReadKodiDB().getKodiMovies(False) kodiItem = ReadKodiDB().getKodiMovie(itemID)
if(self.ShouldStop()): if(self.ShouldStop()):
return True return True
@ -641,12 +641,6 @@ class LibrarySync():
if(allKodiMovies == None): if(allKodiMovies == None):
return False return False
kodiItem = None
for kodimovie in allKodiMovies:
if itemID in kodimovie["file"]:
kodiItem = kodimovie
break
userData=API().getUserData(MB3Movie) userData=API().getUserData(MB3Movie)
timeInfo = API().getTimeInfo(MB3Movie) timeInfo = API().getTimeInfo(MB3Movie)
if kodiItem != None: if kodiItem != None:
@ -666,14 +660,8 @@ class LibrarySync():
return True return True
MB3Episode = ReadEmbyDB().getItem(itemID) MB3Episode = ReadEmbyDB().getItem(itemID)
kodiEpisodes = ReadKodiDB().getKodiEpisodes(MB3Episode.get("SeriesId"),False) kodiItem = ReadKodiDB().getKodiEpisodeByMbItem(MB3Episode)
if (MB3Episode != None): if (MB3Episode != None):
kodiItem = None
comparestring1 = str(MB3Episode.get("ParentIndexNumber")) + "-" + str(MB3Episode.get("IndexNumber"))
matchFound = False
if kodiEpisodes != None:
kodiItem = kodiEpisodes.get(comparestring1, None)
userData=API().getUserData(MB3Episode) userData=API().getUserData(MB3Episode)
timeInfo = API().getTimeInfo(MB3Episode) timeInfo = API().getTimeInfo(MB3Episode)
if kodiItem != None: if kodiItem != None: