Convert some strings to unicode to avoid encoding errors
This commit is contained in:
parent
f21795a99a
commit
7aeb534500
|
@ -199,9 +199,9 @@ class PeerTubeAddon():
|
|||
total_pages = (total / self.items_per_page) + 1
|
||||
|
||||
next_page_item = kodi.generate_item_info(
|
||||
name="{} ({}/{})".format(kodi.get_string(30405),
|
||||
next_page,
|
||||
total_pages),
|
||||
name=u"{} ({}/{})".format(kodi.get_string(30405),
|
||||
next_page,
|
||||
total_pages),
|
||||
url=url
|
||||
)
|
||||
|
||||
|
|
|
@ -219,8 +219,16 @@ class KodiUtils:
|
|||
:return: Entered data or an empty string
|
||||
:rtype: str
|
||||
"""
|
||||
return xbmcgui.Dialog().input(heading=title,
|
||||
type=xbmcgui.INPUT_ALPHANUM)
|
||||
entered_string = xbmcgui.Dialog().input(heading=title,
|
||||
type=xbmcgui.INPUT_ALPHANUM)
|
||||
|
||||
# Let's check the type of "string" against the type "bytes" to confirm
|
||||
# if it is a unicode or a byte string ("bytes" is known in both
|
||||
# python 2 and 3)
|
||||
if isinstance(entered_string, bytes):
|
||||
return entered_string.decode("utf-8")
|
||||
else:
|
||||
return entered_string
|
||||
|
||||
def play(self, url):
|
||||
"""Play the media behind the URL
|
||||
|
|
Loading…
Reference in New Issue