Commit Graph

136 Commits

Author SHA1 Message Date
Simon Cambier
0a57b7bc6a #477 Use Text Extractor as a fallback to AI Image Analyzer 2025-09-03 16:49:13 +02:00
Simon Cambier
b0b9b4de08 Fixed #455 2025-04-04 19:17:44 +02:00
Simon Cambier
8e4bf5ba08 Update to Svelte 5 2025-03-20 21:07:27 +01:00
Simon Cambier
d495f49a35 Split settings into multiple files 2025-02-15 18:15:43 +01:00
Simon Cambier
ca3ca3b24b Small logging refactoring
Most logs are now console.debug
Removed "Omnisearch" prefix in (almost) all logs
Removed timestamp prefix
2024-11-09 17:46:48 +01:00
Bao
1c98d8b2d7 Fix uncaught exceptions (#414)
* Fix handling of folders on create trigger

When creating a directory in the vault, omnisearch attempts to index the directory as a document

`on('create', (file) => any, ...)` is triggered for both files and directories, so any triggers on `create` should handle the case where `file` is a `TFolder`.[^1]

[^1]: https://docs.obsidian.md/Reference/TypeScript+API/Vault/on('create')

For example, after running `mkdir foobar` in the vault directory, the
following exception is thrown:

```stacktrace
documents-repository.ts:53 Omnisearch: Error while adding "foobar" to live cache Error: Not a TFile: "foobar"
    at DocumentsRepository.getAndMapIndexedDocument (documents-repository.ts:85:41)
    at DocumentsRepository.addDocument (documents-repository.ts:43:30)
    at DocumentsRepository.getDocument (documents-repository.ts:69:16)
    at eval (search-engine.ts:82:63)
    at Array.map (<anonymous>)
    at SearchEngine.addFromPaths (search-engine.ts:81:15)
    at eval (main.ts:114:26)
    at e.tryTrigger (app.js:1:723011)
    at e.trigger (app.js:1:722944)
    at t.trigger (app.js:1:741049)
```

* Fix handling of empty canvas files

Canvas files can be empty. e.g. when the "Create new canvas" command is called:

- immediately after the command:
  - a new *empty* .canvas file will be created
  - triggering the `create` event and causing a "Unexpected end of JSON input" error
- when saving the file (<cmd/ctrl>+s or "Save current file" command):
  - `{}` will be written to the file
  - triggering a file `modify` event and causing a "canvas.nodes is not iterable" exception

Examples of the exceptions:

```stacktrace
documents-repository.ts:53 Omnisearch: Error while adding "Untitled.canvas" to live cache SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at DocumentsRepository.getAndMapIndexedDocument (documents-repository.ts:100:27)
    at async DocumentsRepository.addDocument (documents-repository.ts:43:19)
    at async DocumentsRepository.getDocument (documents-repository.ts:69:5)
    at async eval (search-engine.ts:82:25)
    at async Promise.all (index 0)
    at async SearchEngine.addFromPaths (search-engine.ts:80:7)
```

```stacktrace
documents-repository.ts:53 Omnisearch: Error while adding "Untitled.canvas" to live cache TypeError: canvas.nodes is not iterable
    at DocumentsRepository.getAndMapIndexedDocument (documents-repository.ts:103:33)
    at async DocumentsRepository.addDocument (documents-repository.ts:43:19)
    at async NotesIndexer.refreshIndex (notes-indexer.ts:29:7)
```
2024-11-05 18:40:58 +01:00
Simon Cambier
fc19f96dfd Renamed CacheManager to DocumentsRepository 2024-10-13 18:16:25 +02:00
Simon Cambier
e2962ec021 Refactored relevant methods to SearchHistory 2024-10-13 18:01:40 +02:00
Simon Cambier
983fa2120b fix(#245): correctly update embeds on fs events 2024-09-27 13:53:30 +02:00
Simon Cambier
1b442d1f24 feat(#245): in results list, show where an image/pdf is embedded
* Add an index of embeds for reference in results

* Notes embedding images are now shown in results

* Updated dependencies

* Correctly referencing all embeds

* Updated docs

* Basic embedded feature ok
2024-09-25 20:47:27 +02:00
Simon Cambier
5bc393e3ca Merge branch 'master' into develop
# Conflicts:
#	src/settings.ts
2024-07-23 09:56:31 +02:00
Swaggeroo
58cc6400e8 Added Ai Image Analyzer support (#386)
* Added Ai Image Analyzer support

* removed unnecessary null check
2024-07-23 09:51:43 +02:00
Simon Cambier
3611884bc5 #349 - Added a "danger" setting to disable the cache killswitch 2024-06-27 21:25:06 +02:00
Simon Cambier
59cfd877ae Don't needlessly refresh the live cache 2024-06-11 07:03:49 +02:00
Simon Cambier
2f6e25ce47 Don't needlessly refresh the live cache 2024-06-07 12:30:00 +02:00
Simon Cambier
79bcc671b2 Merge branch 'develop' 2024-05-29 18:58:58 +02:00
Simon Cambier
0b70cbeb16 WIP indexing non-existing docs 2024-05-26 18:05:10 +02:00
Simon Cambier
85b7810d07 Renamed and reorganized some objets & methods 2024-05-26 17:39:31 +02:00
Simon Cambier
1e2df5e82a Renamed "Omnisearch" into "SearchEngine" 2024-05-25 23:07:34 +02:00
Simon Cambier
6566a2e958 Massive refactor to get rid of the global app. 2024-05-25 22:49:50 +02:00
Simon Cambier
dcfb77f551 Massive refactoring to get rid of the deprecated global app instance 2024-05-21 21:13:35 +02:00
Simon Cambier
a370041e2f Quick hack for global app 2024-05-18 22:59:45 +02:00
Simon Cambier
482a66eac0 Quick hack for global app 2024-05-18 22:55:33 +02:00
Simon Cambier
5010a47466 Cleaned global app warnings 2024-05-18 09:52:28 +02:00
Simon Cambier
7a6ffb5682 Removed welcome message 2024-05-17 23:10:21 +02:00
Simon Cambier
ec0f8d0a0b Updated welcome message 2024-01-20 12:11:09 +01:00
Simon Cambier
753811fa41 Merge branch 'develop' 2023-11-11 10:08:17 +01:00
Simon Cambier
c8e65558bc "Fixed" a condition 2023-11-10 19:12:20 +01:00
Simon Cambier
1e6478d83e Cleaned some warnings from the deprecated global app object 2023-11-01 14:51:07 +01:00
Simon Cambier
9a218167d7 #302 - Fixed 2023-10-13 08:47:35 +02:00
Simon Cambier
35d3eb04a9 HTTP Server 2023-10-12 20:38:00 +02:00
Simon Cambier
b6c80e15ec #259 - Fixed 2023-08-27 11:35:50 +02:00
YuNing Chen
a077b427eb Add missing async/await (#269) 2023-08-03 12:53:59 +02:00
Simon Cambier
32655a1570 Removed the welcome message 2023-07-28 12:14:45 +02:00
Simon Cambier
362df5360b #229 - "disable on this device" (#238) 2023-05-09 19:11:55 +02:00
Simon Cambier
24bfb94b71 #184 - Verbose logging 2023-03-11 14:43:29 +01:00
Simon Cambier
c1d82dab54 #141 - Added callback when indexing is done 2023-02-11 16:52:33 +01:00
Simon Cambier
c1b3c6d0ec Fixed potential indexing issues 2023-01-20 22:56:02 +01:00
Simon Cambier
42ba653642 Text Extractor requirement 2023-01-19 21:46:53 +01:00
Simon Cambier
ebee93a2aa Registering events sooner 2023-01-19 08:37:43 +01:00
Simon Cambier
3c32e5f70f #182 - Added back an opt-out for the cache, now automatically disabled in case of crash 2023-01-18 22:17:26 +01:00
Simon Cambier
2854bb78b6 Added some labels for Text Extractor 2023-01-03 10:25:38 +01:00
Simon Cambier
c8bdcad17c Small (potential) bugfixes 2022-12-31 21:26:15 +01:00
Simon Cambier
3bdbfe12bf Updated labels and incidentally "fixes" #147 2022-12-11 21:37:56 +01:00
Simon Cambier
18e7c011bc Removed useless cache writing 2022-12-07 18:19:59 +01:00
Simon Cambier
024fffad6d Loading settings asap when plugin is loaded 2022-12-03 19:06:10 +01:00
Simon Cambier
a096969c0f Only automatically clear cache in dev mode 2022-12-01 20:26:02 +01:00
Simon Cambier
2f131f40b6 Clear the cache when disabling the plugin 2022-12-01 13:09:23 +01:00
Simon Cambier
01d859034a Fixed indexingStep messages 2022-11-29 17:37:47 +01:00
Simon Cambier
e8d0efbd5b Logs & cleaning 2022-11-27 16:36:06 +01:00