From 2aefab15455ba8559953f1c6359eb3a437f2a461 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 16 May 2015 20:21:49 -0500 Subject: [PATCH] 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. --- resources/lib/PlayUtils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/lib/PlayUtils.py b/resources/lib/PlayUtils.py index 8e7384a4..198ba8c2 100644 --- a/resources/lib/PlayUtils.py +++ b/resources/lib/PlayUtils.py @@ -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 \ No newline at end of file