Skip to content

Commit

Permalink
Merge pull request #685 from apo86/master
Browse files Browse the repository at this point in the history
Restore functionality of "Following Channels"
  • Loading branch information
anxdpanic authored Sep 9, 2023
2 parents 374a918 + d827906 commit 6ece95b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.twitch" version="3.0.1" name="Twitch" provider-name="anxdpanic, A Talented Community">
<addon id="plugin.video.twitch" version="3.0.2" name="Twitch" provider-name="anxdpanic, A Talented Community">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.requests" version="2.9.1"/>
<import addon="script.module.python.twitch" version="3.0.0"/>
<import addon="script.module.python.twitch" version="3.0.2"/>
</requires>
<extension point="xbmc.python.pluginsource" library="resources/lib/addon_runner.py">
<provides>video</provides>
Expand All @@ -15,7 +15,7 @@
<fanart>resources/media/fanart.jpg</fanart>
</assets>
<news>
[rem] toggle follow
[fix] Following Channels
[lang] updated translations from Weblate
</news>
<platform>all</platform>
Expand Down
4 changes: 2 additions & 2 deletions resources/lib/twitch_addon/addon/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def get_all_streams(self, game_id=None, user_id=None, user_login=None, language=

@api_error_handler
@cache.cache_method(cache_limit=cache.limit)
def get_followed_channels(self, from_id='', to_id='', after='MA==', before='MA==', first=20):
results = self.api.users.get_follows(from_id=from_id, to_id=to_id, after=after, before=before, first=first)
def get_followed_channels(self, user_id='', after='MA==', first=20):
results = self.api.users.get_follows(user_id=user_id, after=after, first=first)
return self.error_check(results)

@api_error_handler
Expand Down
6 changes: 3 additions & 3 deletions resources/lib/twitch_addon/routes/followed.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def route(api, content, after='MA=='):
all_items = list()
followed_ids = list()

followed = api.get_followed_channels(from_id=user_id, after=after, first=per_page)
followed = api.get_followed_channels(user_id=user_id, after=after, first=per_page)
if Keys.DATA in followed:
for follow in followed[Keys.DATA]:
if follow.get(Keys.TO_ID):
followed_ids.append(follow[Keys.TO_ID])
if follow.get(Keys.BROADCASTER_ID):
followed_ids.append(follow[Keys.BROADCASTER_ID])

channels = api.get_users(followed_ids)
if Keys.DATA in channels:
Expand Down

0 comments on commit 6ece95b

Please sign in to comment.