Skip to content

Commit 5450eef

Browse files
authored
Merge pull request #634 from anxdpanic/pr_isengard
2.6.0~beta3
2 parents d410b99 + 4d4d90d commit 5450eef

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

addon.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="plugin.video.twitch" version="2.6.0~beta2" name="Twitch" provider-name="anxdpanic, A Talented Community">
2+
<addon id="plugin.video.twitch" version="2.6.0~beta3" name="Twitch" provider-name="anxdpanic, A Talented Community">
33
<requires>
44
<import addon="xbmc.python" version="2.20.0"/>
55
<import addon="script.module.six" version="1.11.0"/>

resources/lib/twitch_addon/addon/api.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,23 +337,24 @@ def error_check(results):
337337
if isinstance(results, list):
338338
return results
339339

340-
if ('error' in results.get('response', {})) and (results['response']['status'] == 401):
340+
payload = results.copy()
341+
if 'response' in payload:
342+
payload = payload['response']
343+
344+
if ('error' in payload) and (payload['status'] == 401):
341345
_ = kodi.Dialog().ok(
342346
i18n('oauth_heading'),
343347
i18n('oauth_message') % (i18n('settings'), i18n('login'), i18n('get_oauth_token'))
344348
)
345349
sys.exit()
346350

347-
if 'stream' in results and results['stream'] is None:
351+
if 'stream' in payload and payload['stream'] is None:
348352
raise PlaybackFailed()
349353

350-
if 'error' in results.get('response', {}):
351-
raise TwitchException(results)
352-
353-
if 'response' in results:
354-
return results['response']
354+
if 'error' in payload:
355+
raise TwitchException(payload)
355356

356-
return results
357+
return payload
357358

358359
@staticmethod
359360
def return_boolean(results):

0 commit comments

Comments
 (0)