diff --git a/backend/app.js b/backend/app.js index e50dc8d..0cdd414 100644 --- a/backend/app.js +++ b/backend/app.js @@ -2037,6 +2037,8 @@ app.post('/api/getFile', optionalJwt, function (req, res) { if (!file && type) file = db.get(`files.${type}`).find({uid: uid}).value(); } + // check if chat exists for twitch videos + if (file['url'].includes('twitch.tv')) file['chat_exists'] = fs.existsSync(file['path'].substring(0, file['path'].length - 4) + '.twitch_chat.json'); if (file) { res.send({ diff --git a/backend/twitch.js b/backend/twitch.js index 62c390d..fb05fbb 100644 --- a/backend/twitch.js +++ b/backend/twitch.js @@ -28,7 +28,8 @@ async function getCommentsForVOD(clientID, vodId) { created_at: acctCreated }, message: { - body: msg + body: msg, + user_color: user_color } } = c; @@ -49,7 +50,8 @@ async function getCommentsForVOD(clientID, vodId) { timestamp: timestamp, timestamp_str: timestamp_str, name: name, - message: msg + message: msg, + user_color: user_color }); // let line = `${timestamp},${msgCreated.format(tsFormat)},${name},${_id},"${msg.replace(/"/g, '""')}",${acctCreated.format(tsFormat)}`; // return line; diff --git a/src/app/components/twitch-chat/twitch-chat.component.html b/src/app/components/twitch-chat/twitch-chat.component.html index 7ad40fc..634cac6 100644 --- a/src/app/components/twitch-chat/twitch-chat.component.html +++ b/src/app/components/twitch-chat/twitch-chat.component.html @@ -1,11 +1,11 @@