Fix potential sync crash

This commit is contained in:
croneter 2018-09-02 20:34:44 +02:00
parent e14994cf74
commit cda881c25c

View file

@ -804,8 +804,12 @@ class TVShows(Items):
seasonid = self.kodi_db.add_season(showid, season) seasonid = self.kodi_db.add_season(showid, season)
# GET THE FILE AND PATH ##### # GET THE FILE AND PATH #####
do_indirect = not state.DIRECT_PATHS
if state.DIRECT_PATHS: if state.DIRECT_PATHS:
playurl = api.file_path(force_first_media=True) playurl = api.file_path(force_first_media=True)
if playurl is None:
do_indirect = True
else:
playurl = api.validate_playurl(playurl, v.PLEX_TYPE_EPISODE) playurl = api.validate_playurl(playurl, v.PLEX_TYPE_EPISODE)
if "\\" in playurl: if "\\" in playurl:
# Local path # Local path
@ -817,7 +821,7 @@ class TVShows(Items):
parent_path_id = self.kodi_db.parent_path_id(path) parent_path_id = self.kodi_db.parent_path_id(path)
pathid = self.kodi_db.add_video_path(path, pathid = self.kodi_db.add_video_path(path,
id_parent_path=parent_path_id) id_parent_path=parent_path_id)
else: if do_indirect:
# Set plugin path - do NOT use "intermediate" paths for the show # Set plugin path - do NOT use "intermediate" paths for the show
# as with direct paths! # as with direct paths!
filename = api.file_name(force_first_media=True) filename = api.file_name(force_first_media=True)