mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
nonetype fixes and prevent doubled episodes
This commit is contained in:
parent
c680a7d0fe
commit
7481023bd8
1 changed files with 23 additions and 9 deletions
|
@ -168,7 +168,11 @@ class LibrarySync():
|
|||
item['Tag'] = []
|
||||
item['Tag'].append(view.get('title'))
|
||||
|
||||
if allKodiMovies != None:
|
||||
kodimovie = allKodiMovies.get(item["Id"], None)
|
||||
else:
|
||||
kodimovie = None
|
||||
|
||||
if(kodimovie != None):
|
||||
#WriteKodiDB().updateMovieToKodiLibrary(item, kodimovie)
|
||||
updated = WriteKodiDB().updateMovieToKodiLibrary_Batched(item, kodimovie)
|
||||
|
@ -333,6 +337,7 @@ class LibrarySync():
|
|||
progressAction = "Checking"
|
||||
if not matchFound:
|
||||
#no match so we have to create it
|
||||
print "creating episode in incremental sync!"
|
||||
WriteKodiDB().addEpisodeToKodiLibrary(episode)
|
||||
updateNeeded = True
|
||||
progressAction = "Adding"
|
||||
|
@ -467,6 +472,8 @@ class LibrarySync():
|
|||
|
||||
progressAction = "Checking"
|
||||
if not matchFound:
|
||||
#double check the item it might me added delayed by the Kodi scanner
|
||||
if ReadKodiDB().getKodiEpisodeByMbItem(item["Id"],tvshow) == None:
|
||||
#no match so we have to create it
|
||||
WriteKodiDB().addEpisodeToKodiLibrary(item)
|
||||
updateNeeded = True
|
||||
|
@ -728,7 +735,11 @@ class LibrarySync():
|
|||
|
||||
if not item.get('IsFolder'):
|
||||
|
||||
if allKodiMusicVideos != None:
|
||||
kodimusicvideo = allKodiMusicVideos.get(item["Id"], None)
|
||||
else:
|
||||
kodimusicvideo = None
|
||||
|
||||
if(kodimusicvideo != None):
|
||||
#WriteKodiDB().updateMusicVideoToKodiLibrary(item, kodimusicvideo)
|
||||
WriteKodiDB().updateMusicVideoToKodiLibrary_Batched(item, kodimusicvideo)
|
||||
|
@ -894,7 +905,10 @@ class LibrarySync():
|
|||
episodeData = ReadEmbyDB().getEpisodes(item["Id"], False)
|
||||
allKodiTVShows = ReadKodiDB().getKodiTvShows(False)
|
||||
kodishow = allKodiTVShows.get(item["Id"],None)
|
||||
if kodishow != None:
|
||||
kodiEpisodes = ReadKodiDB().getKodiEpisodes(kodishow["tvshowid"],False,True)
|
||||
else:
|
||||
kodiEpisodes = None
|
||||
|
||||
if (episodeData != None):
|
||||
if(pDialog != None):
|
||||
|
|
Loading…
Reference in a new issue