Fix for fanart url containing spaces

This commit is contained in:
tomkat83 2016-11-17 12:21:15 +01:00
parent 8d11fa2a90
commit 0538a250a3

View file

@ -2129,14 +2129,14 @@ class API():
# select image in preferred language # select image in preferred language
for entry in data[fanarttvimage]: for entry in data[fanarttvimage]:
if entry.get("lang") == KODILANGUAGE: if entry.get("lang") == KODILANGUAGE:
allartworks[fanarttype[1]] = entry.get("url") allartworks[fanarttype[1]] = entry.get("url", "").replace(' ', '%20')
break break
# just grab the first english OR undefinded one as fallback # just grab the first english OR undefinded one as fallback
# (so we're actually grabbing the more popular one) # (so we're actually grabbing the more popular one)
if not allartworks.get(fanarttype[1]): if not allartworks.get(fanarttype[1]):
for entry in data[fanarttvimage]: for entry in data[fanarttvimage]:
if entry.get("lang") in ("en", "00"): if entry.get("lang") in ("en", "00"):
allartworks[fanarttype[1]] = entry.get("url") allartworks[fanarttype[1]] = entry.get("url", "").replace(' ', '%20')
break break
# grab extrafanarts in list # grab extrafanarts in list
@ -2149,7 +2149,8 @@ class API():
for entry in data[fanarttvimage]: for entry in data[fanarttvimage]:
if fanartcount < maxfanarts: if fanartcount < maxfanarts:
if xbmcvfs.exists(entry.get("url")): if xbmcvfs.exists(entry.get("url")):
allartworks['Backdrop'].append(entry.get("url")) allartworks['Backdrop'].append(
entry.get("url", "").replace(' ', '%20'))
fanartcount += 1 fanartcount += 1
return allartworks return allartworks