bigbluebutton-Github/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js
Anton Georgiev a263c1388b lint mostly
2016-05-16 14:35:59 +00:00

32 lines
1.0 KiB
JavaScript
Executable File

import Slides from '/imports/api/slides/collection';
export function addSlideToCollection(meetingId, presentationId, slideObject) {
if (Slides.findOne({
meetingId: meetingId,
'slide.id': slideObject.id,
}) == null) {
const entry = {
meetingId: meetingId,
presentationId: presentationId,
slide: {
height_ratio: slideObject.height_ratio,
y_offset: slideObject.y_offset,
num: slideObject.num,
x_offset: slideObject.x_offset,
current: slideObject.current,
img_uri: slideObject.svg_uri != null ? slideObject.svg_uri : slideObject.png_uri,
txt_uri: slideObject.txt_uri,
id: slideObject.id,
width_ratio: slideObject.width_ratio,
swf_uri: slideObject.swf_uri,
thumb_uri: slideObject.thumb_uri,
},
};
const id = Slides.insert(entry);
return id;
//logger.info "added slide id =[#{id}]:#{slideObject.id} in #{meetingId}. Now there
// are #{Slides.find({meetingId: meetingId}).count()} slides in the meeting"
}
};