Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix twireapp#431: empty 'My streams' list #437

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading