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'):
kodishow = allKodiTVShows.get(item["Id"],None) if allKodiTVShows != 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)
kodishow = allKodiTVShows.get(tvshow,None)
if kodishow != None: kodiEpisodes = None
kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],True,True) if allKodiTVShows != None:
else: kodishow = allKodiTVShows.get(tvshow,None)
kodiEpisodes = None if kodishow != None:
kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],True,True)
if(self.ShouldStop(pDialog)): if(self.ShouldStop(pDialog)):
return False return False
@ -578,11 +582,12 @@ 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
show = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],False,False) if kodishow != None:
if show != None: show = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],False,False)
for episode in show: if show != None:
dict = {'episodeid': str(episode["uniqueid"]["unknown"]),'tvshowid': tvshow} for episode in show:
allKodiEpisodeIds.append(dict) dict = {'episodeid': str(episode["uniqueid"]["unknown"]),'tvshowid': tvshow}
allKodiEpisodeIds.append(dict)
showCurrent += 1 showCurrent += 1