Fix UnicodeDecodeError with file paths on sync

- Plex sometimes seems to encode in latin1 instead of utf-8. What the
heck?!?
- Fixes #20
This commit is contained in:
tomkat83 2016-05-06 22:16:56 +02:00
parent 496aa2593a
commit 47409e1535

View file

@ -46,7 +46,6 @@ import xbmcvfs
import clientinfo
import utils
import downloadutils
import requests
from PlexFunctions import PlexToKodiTimefactor, PMSHttpsEnabled
import embydb_functions as embydb
@ -1238,9 +1237,9 @@ class API():
if res is not None:
try:
res = unquote(res).decode('utf-8')
except UnicodeEncodeError:
# Sometimes, unquote seems to return unicode, not string
res = unquote(res)
except UnicodeDecodeError:
# Sometimes, Plex seems to have encoded in latin1
res = unquote(res).decode('latin1')
return res
def getTVShowPath(self):