Skip to content

Commit 4794dfb

Browse files
committed
Presentation properties handling
1 parent 68d0d1a commit 4794dfb

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fails-components/notepadhandler",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Supplies server side notepad handling",
55
"author": "Marten Richter",
66
"license": "AGPL-3.0-or-later",

src/notepadhandler.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,20 @@ export class NoteScreenConnection {
7575
// only lectureuuid
7676
const roomname = this.getRoomName(args.lectureuuid)
7777

78+
const presinfo = this.getPresentationinfo(args)
79+
7880
const screens = this.getNoteScreens(args)
7981

8082
const channelinfo = this.getChannelNoteScreens(args)
8183

84+
const readypresinfo = await presinfo
85+
8286
const readyscreens = await screens
8387

8488
console.log('avil notepadscreens', args.notescreenuuid, readyscreens)
8589
this.notepadio.to(roomname).emit('availscreens', { screens: readyscreens })
8690
this.screenio.to(roomname).emit('availscreens', { screens: readyscreens })
91+
this.notesio.to(roomname).emit('presinfo', readypresinfo)
8792
const readychannels = await channelinfo
8893
console.log('channelinfo', readychannels)
8994

@@ -1378,6 +1383,29 @@ export class NoteScreenConnection {
13781383
}
13791384
}
13801385

1386+
async getPresentationinfo(args) {
1387+
const client = this.redis
1388+
const hmget = promisify(this.redis.hmget).bind(client)
1389+
1390+
try {
1391+
let lectprop = hmget(
1392+
'lecture:' + args.lectureuuid,
1393+
'casttoscreens',
1394+
'backgroundbw',
1395+
'showscreennumber'
1396+
)
1397+
lectprop = await lectprop
1398+
return {
1399+
casttoscreens: lectprop[0],
1400+
backgroundbw: lectprop[1],
1401+
showscreennumber: lectprop[2]
1402+
}
1403+
} catch (error) {
1404+
console.log('getPresentationinfo', error)
1405+
return null
1406+
}
1407+
}
1408+
13811409
async getChannelNoteScreens(args) {
13821410
const client = this.redis
13831411
const lrange = promisify(this.redis.lrange).bind(client)

0 commit comments

Comments
 (0)