bigbluebutton-Github/bigbluebutton-html5/imports/api/timer/server/methods/setTrack.js
Arthurk12 f5a5a960ba feat(timer): adds more songs
Adds 2 more songs to the timer, which can be switched using the radio
buttons inside timer panel.
Changed the music loop logic to make it gapless.
2023-05-18 15:29:35 -03:00

23 lines
824 B
JavaScript

import { check } from 'meteor/check';
import updateTimer from '/imports/api/timer/server/modifiers/updateTimer';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
import { isTrackValid } from '/imports/api/timer/server/helpers';
export default function setTrack(track) {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(meetingId, String);
check(track, String);
//These are bogus values, won't update collection
const time = 0;
const stopwatch = false;
const accumulated = 0;
if (isTrackValid(track)) {
updateTimer('track', meetingId, time, stopwatch, accumulated, track);
} else {
Logger.warn(`User=${requesterUserId} tried to set invalid track '${track}' in meeting=${meetingId}`);
}
}