Removed notification for first time submission if there is a conflict.

This commit is contained in:
Ajay Ramachandran 2019-12-28 00:41:33 -05:00
parent 95ccaf9478
commit d5a679731c

View file

@ -224,7 +224,7 @@ app.get('/api/postVideoSponsorTimes', async function (req, res) {
//check if they are a first time user
//if so, send a notification to discord
if (config.youtubeAPIKey !== null && config.discordFirstTimeSubmissionsWebhookURL !== null) {
if (config.youtubeAPIKey !== null && config.discordFirstTimeSubmissionsWebhookURL !== null && row == null) {
let userSubmissionCountResult = await new Promise((resolve, reject) => {
db.prepare("SELECT count(*) as submissionCount FROM sponsorTimes WHERE userID = ?").get(userID, (err, row) => resolve({err, row}));
});