bigbluebutton-Github/bigbluebutton-html5/imports/api/presentations/server/handlers/presentationExport.js

43 lines
1.3 KiB
JavaScript
Raw Normal View History

import { check } from 'meteor/check';
import sendExportedPresentationChatMsg from '/imports/api/presentations/server/handlers/sendExportedPresentationChatMsg';
import setPresentationExporting from '/imports/api/presentations/server/modifiers/setPresentationExporting';
import setOriginalUriDownload from '/imports/api/presentations/server/modifiers/setOriginalUriDownload';
export default async function handlePresentationExport({ body }, meetingId) {
check(body, Object);
check(meetingId, String);
const {
annotatedFileURI,
originalFileURI,
convertedFileURI,
presId,
typeOfExport,
} = body;
check(annotatedFileURI, String);
check(originalFileURI, String);
check(convertedFileURI, String);
check(presId, String);
check(typeOfExport, String);
2023-08-15 21:30:17 +08:00
if (typeOfExport === 'Original' || typeOfExport === 'Converted') {
if (typeOfExport.indexOf('Converted') !== -1) {
await setOriginalUriDownload(
meetingId,
presId,
convertedFileURI,
);
} else {
await setOriginalUriDownload(
meetingId,
presId,
originalFileURI,
);
}
} else {
await sendExportedPresentationChatMsg(meetingId, presId, annotatedFileURI, typeOfExport);
}
await setPresentationExporting(meetingId, presId, { status: 'EXPORTED' });
}