Uncomment debug lines
parent
90f672b288
commit
ac953b0bb5
|
@ -9,8 +9,8 @@ export async function processBans(streamer: twitch.StreamerUserIdTokenPair) {
|
|||
await dbconn.query("DELETE FROM bans");
|
||||
var response = await twitch.streamerApiRequest(streamer,
|
||||
`/moderation/banned?broadcaster_id=${streamer.userid}&first=100`);
|
||||
//log(LogLevel.DEBUG,"Ban API response:")
|
||||
//log(LogLevel.DEBUG,JSON.stringify(response,null,2));
|
||||
log(LogLevel.DEBUG,"Ban API response:")
|
||||
log(LogLevel.DEBUG,JSON.stringify(response,null,2));
|
||||
while (true) {
|
||||
var insertBanQuery = "INSERT INTO bans (userid) VALUES ";
|
||||
var banRow = 0; // Used for $1, $2, etc. in parameterized query
|
||||
|
@ -37,8 +37,8 @@ export async function processBans(streamer: twitch.StreamerUserIdTokenPair) {
|
|||
var oldFirstUserid = response.data[0].user_id;
|
||||
response = await twitch.streamerApiRequest(streamer,
|
||||
`/moderation/banned?broadcaster_id=${streamer.userid}&after=${response.pagination.cursor}&first=100`);
|
||||
//log(LogLevel.DEBUG,"Ban API response:");
|
||||
//log(LogLevel.DEBUG,JSON.stringify(response,null,2));
|
||||
log(LogLevel.DEBUG,"Ban API response:");
|
||||
log(LogLevel.DEBUG,JSON.stringify(response,null,2));
|
||||
// Work around broken api endpoint giving a cursor referring to the
|
||||
// current page, causing an infinite loop
|
||||
if (oldFirstUserid == response.data[0].user_id) break;
|
||||
|
|
|
@ -9,8 +9,8 @@ export async function processSubscriptions(streamer: twitch.StreamerUserIdTokenP
|
|||
await dbconn.query("DELETE FROM subscriptions");
|
||||
var response = await twitch.streamerApiRequest(streamer,
|
||||
`/subscriptions?broadcaster_id=${streamer.userid}&first=100`);
|
||||
//log(LogLevel.DEBUG,"Subscriptions API response:")
|
||||
//log(LogLevel.DEBUG,JSON.stringify(response,null,2));
|
||||
log(LogLevel.DEBUG,"Subscriptions API response:")
|
||||
log(LogLevel.DEBUG,JSON.stringify(response,null,2));
|
||||
while (true) {
|
||||
var insertSubscriptionQuery = "INSERT INTO subscriptions (userid) VALUES ";
|
||||
var subscriptionRow = 0; // Used for $1, $2, etc. in parameterized query
|
||||
|
@ -36,8 +36,8 @@ export async function processSubscriptions(streamer: twitch.StreamerUserIdTokenP
|
|||
response = await twitch.streamerApiRequest(streamer,
|
||||
`/subscriptions?broadcaster_id=${streamer.userid}&after=${response.pagination.cursor}&first=100`);
|
||||
if (oldFirstUserid == response.data[0].user_id) break;
|
||||
//log(LogLevel.DEBUG,"Subscription API response:");
|
||||
//log(LogLevel.DEBUG,JSON.stringify(response,null,2));
|
||||
log(LogLevel.DEBUG,"Subscription API response:");
|
||||
log(LogLevel.DEBUG,JSON.stringify(response,null,2));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue