2022-03-25 03:05:20 +08:00
|
|
|
import AudioCaptions from '/imports/api/audio-captions';
|
|
|
|
import Auth from '/imports/ui/services/auth';
|
|
|
|
|
|
|
|
const getAudioCaptionsData = () => {
|
|
|
|
const audioCaptions = AudioCaptions.findOne({ meetingId: Auth.meetingID });
|
|
|
|
|
2022-04-13 23:00:45 +08:00
|
|
|
if (audioCaptions) {
|
|
|
|
return {
|
|
|
|
transcriptId: audioCaptions.transcriptId,
|
|
|
|
transcript: audioCaptions.transcript,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
transcriptId: '',
|
|
|
|
transcript: '',
|
|
|
|
};
|
2022-03-25 03:05:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
const getAudioCaptions = () => Session.get('audioCaptions') || false;
|
|
|
|
|
|
|
|
const setAudioCaptions = (value) => Session.set('audioCaptions', value);
|
|
|
|
|
|
|
|
const hasAudioCaptions = () => {
|
|
|
|
const audioCaptions = AudioCaptions.findOne(
|
|
|
|
{ meetingId: Auth.meetingID },
|
|
|
|
{ fields: {} },
|
|
|
|
);
|
|
|
|
|
|
|
|
return !!audioCaptions;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
getAudioCaptionsData,
|
|
|
|
getAudioCaptions,
|
|
|
|
setAudioCaptions,
|
|
|
|
hasAudioCaptions,
|
|
|
|
};
|