Skip to content

Commit

Permalink
fix #431: empty 'My streams' list
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannGutej authored and samfundev committed Nov 28, 2023
1 parent 4dc7114 commit c0828f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class LoginActivity extends SetupBaseActivity {
"?client_id=" + Service.getApplicationClientID() +
"&redirect_uri=http%3A%2F%2Flocalhost/oauth_authorizing" +
"&response_type=token" +
"&scope=user:read:email%20user:edit:follows%20user:read:subscriptions%20chat:edit%20chat:read";
"&scope=user:read:email%20user:edit:follows%20user:read:subscriptions%20chat:edit%20chat:read%20user:read:follows";
private final int SHOW_WEBVIEW_ANIMATION_DURATION = 900;
private final int SHOW_SUCCESS_ICON_DURATION = 800;
private final int REVEAL_ANIMATION_DURATION = 650;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/perflyst/twire/service/JSONService.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public static UserInfo getUserInfo(JSONObject userObject) throws JSONException {
// Twitch doesn't keep their field names consistent, so we need to make them consistent.
if (userObject.has("broadcaster_login")) { // Search uses id, broadcaster_login, display_name
return new UserInfo(
userObject.getInt("id"),
userObject.getInt("broadcaster_id"),
userObject.getString("broadcaster_login"),
userObject.getString("display_name")
userObject.getString("broadcaster_name")
);
} else if (userObject.has("login")) { // Users uses id, login, display_name
return new UserInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected ArrayList<ChannelInfo> doInBackground(Object... params) {

int userId = mSettings.getGeneralTwitchUserID();

final String BASE_URL = "https://api.twitch.tv/helix/users/follows?first=100&from_id=" + userId + "&after=";
final String BASE_URL = "https://api.twitch.tv/helix/channels/followed?first=100&user_id=" + userId + "&after=";

// Get all the userIds of a users follows
try {
Expand All @@ -69,7 +69,7 @@ protected ArrayList<ChannelInfo> doInBackground(Object... params) {

for (int i = 0; i < follows.length(); i++) {
JSONObject follow = follows.getJSONObject(i);
userSubs.add(follow.getInt("to_id"));
userSubs.add(follow.getInt("broadcaster_id"));
}

JSONObject pagination = page.getJSONObject("pagination");
Expand Down

0 comments on commit c0828f8

Please sign in to comment.