f5a5a960ba
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.
23 lines
824 B
JavaScript
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}`);
|
|
}
|
|
}
|