Fix potential sync crash
This commit is contained in:
parent
e14994cf74
commit
cda881c25c
1 changed files with 15 additions and 11 deletions
|
@ -804,20 +804,24 @@ 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)
|
||||||
playurl = api.validate_playurl(playurl, v.PLEX_TYPE_EPISODE)
|
if playurl is None:
|
||||||
if "\\" in playurl:
|
do_indirect = True
|
||||||
# Local path
|
|
||||||
filename = playurl.rsplit("\\", 1)[1]
|
|
||||||
else:
|
else:
|
||||||
# Network share
|
playurl = api.validate_playurl(playurl, v.PLEX_TYPE_EPISODE)
|
||||||
filename = playurl.rsplit("/", 1)[1]
|
if "\\" in playurl:
|
||||||
path = playurl.replace(filename, "")
|
# Local path
|
||||||
parent_path_id = self.kodi_db.parent_path_id(path)
|
filename = playurl.rsplit("\\", 1)[1]
|
||||||
pathid = self.kodi_db.add_video_path(path,
|
else:
|
||||||
id_parent_path=parent_path_id)
|
# Network share
|
||||||
else:
|
filename = playurl.rsplit("/", 1)[1]
|
||||||
|
path = playurl.replace(filename, "")
|
||||||
|
parent_path_id = self.kodi_db.parent_path_id(path)
|
||||||
|
pathid = self.kodi_db.add_video_path(path,
|
||||||
|
id_parent_path=parent_path_id)
|
||||||
|
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)
|
||||||
|
|
Loading…
Reference in a new issue