Skip to content

Commit 680866e

Browse files
committed
Refactor Twitch component methods and update subscription handling
- Removed the getUserSubscriptions method from the Twitch app. - Updated the new-subscriber source to use getBroadcasterSubscriptions instead of getUserSubscriptions. - Adjusted timestamp generation in the getMeta method for better accuracy.
1 parent dfbe28c commit 680866e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

components/twitch/sources/new-subscriber/new-subscriber.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ export default {
1111
...common.methods,
1212
getMeta(item) {
1313
const {
14-
user_id, user_name,
14+
user_id,
15+
user_name,
1516
} = item;
1617

17-
const ts = new Date().getTime();
18+
const ts = new Date.now();
1819

1920
return {
2021
id: user_id + ts,
@@ -34,9 +35,9 @@ export default {
3435
const params = {
3536
broadcaster_id: this.db.get("authenticatedUserId"),
3637
};
37-
// get the user_ids of the streamers followed by the authenticated user
38+
// get subscribers to the authenticated user's channel
3839
const subscriptions = this.paginate(
39-
this.twitch.getUserSubscriptions.bind(this),
40+
this.twitch.getBroadcasterSubscriptions.bind(this),
4041
params,
4142
);
4243

components/twitch/twitch.app.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ export default {
142142
async getUserFollows(params) {
143143
return await this._makeRequest("GET", "channels/followers", params);
144144
},
145-
async getUserSubscriptions(params) {
146-
return await this._makeRequest("GET", "subscriptions", params);
147-
},
148145
async getFollowedChannels(params) {
149146
return await this._makeRequest("GET", "channels/followed", params);
150147
},

0 commit comments

Comments
 (0)