Skip to content

Commit

Permalink
hotfix: fix deprecated apis
Browse files Browse the repository at this point in the history
  • Loading branch information
sneljo1 committed May 24, 2020
1 parent b969485 commit db49b57
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"repository": "Superjo149/auryo",
"homepage": "http://auryo.com",
"productName": "Auryo",
"version": "2.5.3",
"version": "2.5.4",
"author": {
"name": "Jonas Snellinckx",
"email": "jonas.snellinckx@gmail.com"
Expand Down
13 changes: 12 additions & 1 deletion src/common/store/auth/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,18 @@ export function getAuthLikesIfNeeded(): ThunkResult<void> {
};
}

export const getAuthFollowings = () => action(AuthActionTypes.SET_FOLLOWINGS, fetchToObject(SC.getFollowingsUrl()));
export const getAuthFollowings = (): ThunkResult<void> => (dispatch, getState) => {
const state = getState();
const {
auth: { me }
} = state;

if (!me || !me.id) {
return;
}

dispatch(action(AuthActionTypes.SET_FOLLOWINGS, fetchToObject(SC.getFollowingsUrl(me.id.toString()))));
};

/**
* Toggle following of a specific user
Expand Down
30 changes: 19 additions & 11 deletions src/common/utils/soundcloudUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,20 +232,28 @@ export function getMeUrl() {
});
}

export function getFollowingsUrl() {
return makeUrl('me/followings/ids', {
oauth_token: true,
limit: 5000,
linked_partitioning: 1
});
export function getFollowingsUrl(userId: string) {
return makeUrl(
`users/${userId}/followings/ids`,
{
oauth_token: true,
limit: 5000,
linked_partitioning: 1
},
true
);
}

export function getRepostIdsUrl(playlist?: boolean) {
return makeUrl(`e1/me/${playlist ? 'playlist' : 'track'}_reposts/ids`, {
oauth_token: true,
limit: 5000,
linked_partitioning: 1
});
return makeUrl(
`me/${playlist ? 'playlist' : 'track'}_reposts/ids`,
{
oauth_token: true,
limit: 200,
linked_partitioning: 1
},
true
);
}

export function updateLikeUrl(trackId: string | number) {
Expand Down

0 comments on commit db49b57

Please sign in to comment.