Skip to content

Commit

Permalink
Merge pull request #561 from anxdpanic/pr_isengard
Browse files Browse the repository at this point in the history
2.5.6
  • Loading branch information
anxdpanic authored May 14, 2021
2 parents 1dceacf + 3e02ed6 commit 0c89300
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
5 changes: 2 additions & 3 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.twitch" version="2.5.5" name="Twitch" provider-name="anxdpanic, A Talented Community">
<addon id="plugin.video.twitch" version="2.5.6" name="Twitch" provider-name="anxdpanic, A Talented Community">
<requires>
<import addon="xbmc.python" version="2.20.0"/>
<import addon="script.module.six" version="1.11.0"/>
Expand All @@ -13,8 +13,7 @@
<extension point="xbmc.addon.metadata">
<platform>all</platform>
<news>
[fix] dialogs
[lang] added Russian translation - DimmKG
[fix] Python 2 encoding issues
</news>
<assets>
<icon>icon.png</icon>
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.5.6
[fix] Python 2 encoding issues

2.5.5
[fix] dialogs
[lang] added Russian translation - DimmKG
Expand Down
7 changes: 7 additions & 0 deletions resources/lib/twitch_addon/addon/menu_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
See LICENSES/GPL-3.0-only for more information.
"""

from six import PY2

from . import utils
from .common import kodi
from .constants import MODES, Scripts
Expand All @@ -32,6 +34,8 @@ def clear_search_history(search_type, do_refresh=False):


def remove_search_history(search_type, query, do_refresh=True):
if PY2 and isinstance(query, unicode):
query = query.encode('utf-8')
query_label = '[B]%s[/B]' % query
params = {'mode': MODES.REMOVESEARCHHISTORY, 'search_type': search_type, 'query': query}
if not do_refresh:
Expand Down Expand Up @@ -62,6 +66,9 @@ def edit_block(target_id, display_name):


def add_blacklist(target_id, display_name, list_type='user'):
if PY2 and isinstance(display_name, unicode):
display_name = display_name.encode('utf-8')

return run_plugin(i18n('add_blacklist') % ''.join(['[COLOR=white][B]', display_name, '[/B][/COLOR]']),
{'mode': MODES.EDITBLACKLIST, 'target_id': target_id, 'name': display_name, 'list_type': list_type, 'refresh': True})

Expand Down
5 changes: 5 additions & 0 deletions resources/lib/twitch_addon/routes/edit_blacklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
SPDX-License-Identifier: GPL-3.0-only
See LICENSES/GPL-3.0-only for more information.
"""

from six import PY2

from ..addon import utils
from ..addon.common import kodi
from ..addon.constants import Scripts
Expand All @@ -28,6 +31,8 @@ def route(list_type='user', target_id=None, name=None, remove=False, refresh=Fal
else:
result = utils.remove_blacklist(list_type)
if result:
if PY2 and isinstance(result[1], unicode):
result[1] = result[1].encode('utf-8')
kodi.notify(msg=i18n('removed_from_blacklist') % result[1], sound=False)

if refresh:
Expand Down
8 changes: 7 additions & 1 deletion resources/lib/twitch_addon/routes/edit_qualities.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
SPDX-License-Identifier: GPL-3.0-only
See LICENSES/GPL-3.0-only for more information.
"""

from six import PY2

from ..addon import utils
from ..addon.common import kodi
from ..addon.constants import ADAPTIVE_SOURCE_TEMPLATE, LINE_LENGTH
Expand Down Expand Up @@ -39,4 +42,7 @@ def route(api, content_type, target_id=None, name=None, video_id=None, remove=Fa
else:
result = utils.remove_default_quality(content_type)
if result:
kodi.notify(msg=i18n('removed_default_quality') % (content_type, result[result.keys()[0]]['name']), sound=False)
name = result[result.keys()[0]]['name']
if PY2 and isinstance(name, unicode):
name = name.encode('utf-8')
kodi.notify(msg=i18n('removed_default_quality') % (content_type, name), sound=False)
7 changes: 7 additions & 0 deletions resources/lib/twitch_addon/routes/token_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
SPDX-License-Identifier: GPL-3.0-only
See LICENSES/GPL-3.0-only for more information.
"""

from six import PY2

from ..addon import utils
from ..addon.common import kodi
from ..addon.google_firebase import dynamic_links_short_url
Expand All @@ -22,6 +25,10 @@ def route(api):
except:
short_url = None
prompt_url = short_url if short_url else i18n('authorize_url_fail')

if PY2 and isinstance(prompt_url, unicode):
prompt_url = prompt_url.encode('utf-8')

result = kodi.Dialog().ok(i18n('authorize_heading'),
i18n('authorize_message') + '[CR]%s' % prompt_url)
kodi.show_settings()

0 comments on commit 0c89300

Please sign in to comment.