feat(ocr): allow manual processing of OCR

This commit is contained in:
Elian Doran
2026-04-01 17:09:26 +03:00
parent 6393d2c188
commit d8ea0c7bcf
2 changed files with 0 additions and 18 deletions

View File

@@ -49,10 +49,6 @@ async function processNoteOCR(req: Request<{ noteId: string }>) {
const { noteId } = req.params;
const { language = 'eng', forceReprocess = false } = req.body || {};
if (!ocrService.isOCREnabled()) {
return [400, { success: false, message: 'OCR is not enabled in settings' }];
}
const note = becca.getNote(noteId);
if (!note) {
return [404, { success: false, message: 'Note not found' }];
@@ -111,10 +107,6 @@ async function processAttachmentOCR(req: Request<{ attachmentId: string }>) {
const { attachmentId } = req.params;
const { language = 'eng', forceReprocess = false } = req.body || {};
if (!ocrService.isOCREnabled()) {
return [400, { success: false, message: 'OCR is not enabled in settings' }];
}
const attachment = becca.getAttachment(attachmentId);
if (!attachment) {
return [404, { success: false, message: 'Attachment not found' }];

View File

@@ -110,11 +110,6 @@ class OCRService {
* Process OCR for a note (image type)
*/
async processNoteOCR(noteId: string, options: OCRProcessingOptions = {}): Promise<OCRResult | null> {
if (!this.isOCREnabled()) {
log.info('OCR is disabled in settings');
return null;
}
const note = becca.getNote(noteId);
if (!note) {
log.error(`Note ${noteId} not found`);
@@ -168,11 +163,6 @@ class OCRService {
* Process OCR for an attachment
*/
async processAttachmentOCR(attachmentId: string, options: OCRProcessingOptions = {}): Promise<OCRResult | null> {
if (!this.isOCREnabled()) {
log.info('OCR is disabled in settings');
return null;
}
const attachment = becca.getAttachment(attachmentId);
if (!attachment) {
log.error(`Attachment ${attachmentId} not found`);