mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Make filepath more resiliant
to user mistakes when setting up a network share with extra trailing slashes
This commit is contained in:
parent
97bd3e653d
commit
f0f36b3b19
2 changed files with 8 additions and 3 deletions
|
@ -385,9 +385,10 @@ class API(object):
|
|||
filepath = ""
|
||||
|
||||
else:
|
||||
if "\\\\" in filepath:
|
||||
if filepath.startswith('\\\\'):
|
||||
# append smb protocol
|
||||
filepath = filepath.replace("\\\\", "smb://")
|
||||
filepath = filepath.replace("\\\\", "smb://", 1)
|
||||
filepath = filepath.replace("\\\\", "\\")
|
||||
filepath = filepath.replace("\\", "/")
|
||||
|
||||
if 'VideoType' in self.item:
|
||||
|
@ -396,6 +397,9 @@ class API(object):
|
|||
elif self.item['VideoType'] == "BluRay":
|
||||
filepath = "%s/BDMV/index.bdmv" % filepath
|
||||
|
||||
# In case user made a mistake with the network share
|
||||
filepath = filepath.replace("\\\\", "\\")
|
||||
|
||||
if "\\" in filepath:
|
||||
# Local path scenario, with special videotype
|
||||
filepath = filepath.replace("/", "\\")
|
||||
|
|
|
@ -224,7 +224,8 @@ class PlayUtils():
|
|||
|
||||
# Assign network protocol
|
||||
if path.startswith('\\\\'):
|
||||
path = path.replace('\\\\', "smb://")
|
||||
path = path.replace('\\\\', "smb://", 1)
|
||||
path = path.replace('\\\\', "\\")
|
||||
path = path.replace('\\', "/")
|
||||
|
||||
if "://" in path:
|
||||
|
|
Loading…
Reference in a new issue