2022-07-20 03:36:00 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import Presentations from '/imports/api/presentations';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
|
|
|
|
export default function setPresentationExporting(meetingId, presentationId, exportation) {
|
|
|
|
check(meetingId, String);
|
|
|
|
check(presentationId, String);
|
|
|
|
check(exportation, Object);
|
|
|
|
|
|
|
|
const selector = {
|
|
|
|
meetingId,
|
|
|
|
id: presentationId,
|
|
|
|
};
|
|
|
|
|
|
|
|
const modifier = {
|
|
|
|
$set: {
|
|
|
|
exportation,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
|
|
const { numberAffected } = Presentations.upsert(selector, modifier);
|
|
|
|
|
|
|
|
if (numberAffected) {
|
2022-07-22 03:39:19 +08:00
|
|
|
const status = `isRunning=${exportation.isRunning} error=${exportation.error}`;
|
|
|
|
Logger.info(`Set exporting status on presentation ${presentationId} in meeting ${meetingId} ${status}`);
|
2022-07-20 03:36:00 +08:00
|
|
|
}
|
|
|
|
} catch (err) {
|
2022-07-22 03:39:19 +08:00
|
|
|
Logger.error(`Could not set exporting status on pres ${presentationId} in meeting ${meetingId} ${err}`);
|
2022-07-20 03:36:00 +08:00
|
|
|
}
|
|
|
|
}
|