Fix unicode error once and for all

Turns out to keep a variable that's unicode and keep working with that
variable as unicode, need to do unicode(variable). Reincoding using
.encode('utf-8') is not the same!!  Added extra logging for the future
to help debug direct play.
This commit is contained in:
angelblue05 2015-05-16 20:21:49 -05:00
parent cdde5ce5ea
commit 2aefab1545

View file

@ -313,11 +313,15 @@ class PlayUtils():
path = result[u'Path']
# Verify the device has access to the direct path
if os.path.exists(path.encode('utf-8')) == True:
if os.path.exists(unicode(path)) == True:
# Local or Network path
self.logMsg("Path exists.", 2)
return True
elif ":\\" not in path:
# Give benefit of the doubt for nfs protocol
# Does not behave with os.path.exists
self.logMsg("Can't verify path. Still try direct play.", 2)
return True
else:
self.logMsg("Path is detected as a Url. Try direct streaming.", 2)
return False