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