some more nonetype fixes

This commit is contained in:
Marcel van der Veldt 2015-03-29 23:19:53 +02:00
parent 7481023bd8
commit 9a17eab206

View file

@ -516,7 +516,10 @@ class LibrarySync():
for item in tvShowData: for item in tvShowData:
if item.get('IsFolder'): if item.get('IsFolder'):
if allKodiTVShows != None:
kodishow = allKodiTVShows.get(item["Id"],None) kodishow = allKodiTVShows.get(item["Id"],None)
else:
kodishow = None
if(kodishow != None): if(kodishow != None):
updated = WriteKodiDB().updateTVShowToKodiLibrary(item,kodishow) updated = WriteKodiDB().updateTVShowToKodiLibrary(item,kodishow)
@ -536,11 +539,12 @@ class LibrarySync():
showCurrent = 1 showCurrent = 1
for tvshow in allTVShows: for tvshow in allTVShows:
episodeData = ReadEmbyDB().getEpisodes(tvshow,True) episodeData = ReadEmbyDB().getEpisodes(tvshow,True)
kodiEpisodes = None
if allKodiTVShows != None:
kodishow = allKodiTVShows.get(tvshow,None) kodishow = allKodiTVShows.get(tvshow,None)
if kodishow != None: if kodishow != None:
kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],True,True) kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],True,True)
else:
kodiEpisodes = None
if(self.ShouldStop(pDialog)): if(self.ShouldStop(pDialog)):
return False return False
@ -578,6 +582,7 @@ class LibrarySync():
#add all kodi episodes to a list with episodes for use later on to delete episodes #add all kodi episodes to a list with episodes for use later on to delete episodes
#the mediabrowser ID is set as uniqueID in the NFO... for some reason this has key 'unknown' in the json response #the mediabrowser ID is set as uniqueID in the NFO... for some reason this has key 'unknown' in the json response
if kodishow != None:
show = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],False,False) show = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],False,False)
if show != None: if show != None:
for episode in show: for episode in show: