Nonetype checks

This commit is contained in:
xnappo 2015-03-29 13:54:49 -05:00
parent b81c004331
commit 526e079f44

View file

@ -440,9 +440,12 @@ class LibrarySync():
allKodiTVShows = ReadKodiDB().getKodiTvShows(False) allKodiTVShows = ReadKodiDB().getKodiTvShows(False)
if allKodiTVShows != None: if allKodiTVShows != None:
kodishow = allKodiTVShows.get(tvshow,None) kodishow = allKodiTVShows.get(tvshow,None)
if kodishow != None:
kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],True,True) kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],True,True)
else: else:
kodiEpisodes = None kodiEpisodes = None
else:
kodiEpisodes = None
if episodeData != None: if episodeData != None:
@ -530,6 +533,7 @@ class LibrarySync():
for tvshow in allTVShows: for tvshow in allTVShows:
episodeData = ReadEmbyDB().getEpisodes(tvshow,True) episodeData = ReadEmbyDB().getEpisodes(tvshow,True)
kodishow = allKodiTVShows.get(tvshow,None) kodishow = allKodiTVShows.get(tvshow,None)
if kodishow != None:
kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],True,True) kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],True,True)
if(self.ShouldStop(pDialog)): if(self.ShouldStop(pDialog)):
@ -891,6 +895,7 @@ class LibrarySync():
episodeData = ReadEmbyDB().getEpisodes(item["Id"], False) episodeData = ReadEmbyDB().getEpisodes(item["Id"], False)
allKodiTVShows = ReadKodiDB().getKodiTvShows(False) allKodiTVShows = ReadKodiDB().getKodiTvShows(False)
kodishow = allKodiTVShows.get(item["Id"],None) kodishow = allKodiTVShows.get(item["Id"],None)
if kodishow != None:
kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],False,True) kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],False,True)
if (episodeData != None): if (episodeData != None):