mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Officially fix the os.path.exists
By getting rid of it, and using xbmcvfs instead. Ha!
This commit is contained in:
parent
f5e80ac448
commit
69064b4579
1 changed files with 9 additions and 8 deletions
|
@ -5,10 +5,10 @@
|
||||||
import xbmc
|
import xbmc
|
||||||
import xbmcgui
|
import xbmcgui
|
||||||
import xbmcaddon
|
import xbmcaddon
|
||||||
|
import xbmcvfs
|
||||||
|
|
||||||
from ClientInformation import ClientInformation
|
from ClientInformation import ClientInformation
|
||||||
import Utils as utils
|
import Utils as utils
|
||||||
import os
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
|
@ -314,21 +314,22 @@ class PlayUtils():
|
||||||
# File has no path in server
|
# File has no path in server
|
||||||
return False
|
return False
|
||||||
|
|
||||||
path = result[u'Path']
|
# Convert Emby path to a path we can verify
|
||||||
|
path = self.directPlay(result)
|
||||||
try:
|
try:
|
||||||
pathexists = os.path.exists(path)
|
pathexists = xbmcvfs.exists(path)
|
||||||
except UnicodeEncodeError:
|
except:
|
||||||
pathexists = os.path.exists(path.encode('utf-8'))
|
pathexists = False
|
||||||
|
|
||||||
# Verify the device has access to the direct path
|
# Verify the device has access to the direct path
|
||||||
if pathexists:
|
if pathexists:
|
||||||
# Local or Network path
|
# Local or Network path
|
||||||
self.logMsg("Path exists.", 2)
|
self.logMsg("Path exists.", 2)
|
||||||
return True
|
return True
|
||||||
elif ":\\" not in path:
|
elif ":\\" not in path:
|
||||||
# Give benefit of the doubt for nfs protocol
|
# Give benefit of the doubt.
|
||||||
# Does not behave with os.path.exists
|
|
||||||
self.logMsg("Can't verify path. Still try direct play.", 2)
|
self.logMsg("Can't verify path. Still try direct play.", 2)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.logMsg("Path is detected as a Url: %s. Try direct streaming." % path, 2)
|
self.logMsg("Path is detected as follow: %s. Try direct streaming." % path, 2)
|
||||||
return False
|
return False
|
Loading…
Reference in a new issue