Updated twitch chat component to support user colors and to auto open if the chat has already been downloaded

This commit is contained in:
Isaac Abadi
2020-12-08 22:57:09 -05:00
parent 8c916d8fe4
commit f425b9842f
4 changed files with 9 additions and 5 deletions

View File

@@ -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({

View File

@@ -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;