feat: board opacity/background link with the room + start of screenshots feat

This commit is contained in:
leokontente 2025-06-05 14:31:53 +02:00
parent cf7fb776bd
commit 69a4b393f5
6 changed files with 106 additions and 28 deletions

View file

@ -112,21 +112,31 @@ db.prototype = {
},
// Board metadata commands
createBoardMetas(room, id, board) {
const boardString = JSON.stringify(board)
createBoardMetas(room, id, metaObj) {
redisClient.hset(
`${REDIS_PREFIX}-room:${room}-board`,
id,
boardString
JSON.stringify(metaObj)
)
},
getBoardMetas(room, callback) {
redisClient.hgetall(`${REDIS_PREFIX}-room:${room}-board`, (err, res) => {
console.log('board metas', res)
callback(JSON.parse(res))
const metas = {}
if (res) {
for (const key in res) {
try {
metas[key] = JSON.parse(res[key])
} catch (e) {
console.error('JSON error in board metas', key, res[key])
}
}
}
callback(metas)
})
},
editBoardMetas(room, id, prop, value) {
redisClient.hget(`${REDIS_PREFIX}-room:${room}-board`, id, (err, res) => {
const board = JSON.parse(res)