mirror of https://github.com/laurent22/joplin.git
Desktop: Make OCR results available to search immediately after completion
parent
35fe392058
commit
6f0fd4219e
|
@ -624,7 +624,11 @@ class Application extends BaseApplication {
|
|||
|
||||
await this.setupOcrService();
|
||||
|
||||
eventManager.on(EventName.OcrServiceResourcesProcessed, () => {
|
||||
eventManager.on(EventName.OcrServiceResourcesProcessed, async () => {
|
||||
await ResourceService.instance().indexNoteResources();
|
||||
});
|
||||
|
||||
eventManager.on(EventName.NoteResourceIndexed, async () => {
|
||||
SearchEngine.instance().scheduleSyncTables();
|
||||
});
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"electronRebuild": "gulp electronRebuild",
|
||||
"tsc": "tsc --project tsconfig.json",
|
||||
"watch": "tsc --watch --preserveWatchOutput --project tsconfig.json",
|
||||
"start": "gulp before-start && electron . --env dev --log-level debug --open-dev-tools",
|
||||
"start": "gulp before-start && electron . --env dev --log-level debug --open-dev-tools --no-welcome",
|
||||
"test": "jest",
|
||||
"test-ui": "playwright test",
|
||||
"test-ci": "yarn test && sh ./integration-tests/run-ci.sh",
|
||||
|
|
|
@ -17,6 +17,7 @@ export enum EventName {
|
|||
KeymapChange = 'keymapChange',
|
||||
NoteContentChange = 'noteContentChange',
|
||||
OcrServiceResourcesProcessed = 'ocrServiceResourcesProcessed',
|
||||
NoteResourceIndexed = 'noteResourceIndexed',
|
||||
}
|
||||
|
||||
export class EventManager {
|
||||
|
|
|
@ -9,6 +9,7 @@ import Resource from '../models/Resource';
|
|||
import SearchEngine from './search/SearchEngine';
|
||||
import ItemChangeUtils from './ItemChangeUtils';
|
||||
import time from '../time';
|
||||
import eventManager, { EventName } from '../eventManager';
|
||||
const { sprintf } = require('sprintf-js');
|
||||
|
||||
export default class ResourceService extends BaseService {
|
||||
|
@ -107,6 +108,8 @@ export default class ResourceService extends BaseService {
|
|||
|
||||
this.isIndexing_ = false;
|
||||
|
||||
eventManager.emit(EventName.NoteResourceIndexed);
|
||||
|
||||
this.logger().info('ResourceService::indexNoteResources: Completed');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue