From 98e20130b40152432bb356069d47a4c3cfb46a41 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Sun, 8 Jan 2023 10:13:20 +0100 Subject: [PATCH] Re-enabling PDF & Image indexing on mobile if Text Extractor is installed --- src/settings.ts | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/settings.ts b/src/settings.ts index 49f5c70..777a6b6 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -85,29 +85,29 @@ export class SettingsTab extends PluginSettingTab { new Setting(containerEl).setName('Indexing').setHeading() if (getTextExtractor()) { - new Setting(containerEl).setDesc( - '👍 You have installed Text Extractor, Omnisearch will use it to index PDFs and images.' - ) + const desc = new DocumentFragment() + desc.createSpan({}, span => { + span.innerHTML = `👍 You have installed Text Extractor, Omnisearch will use it to index PDFs and images. +
Text extraction only works on desktop, but the cache can be synchronized with your mobile device.` + }) + new Setting(containerEl).setDesc(desc) } else { const label = new DocumentFragment() label.createSpan({}, span => { - span.innerHTML = - `⚠️ Omnisearch will soon require Text Extractor to index PDFs and images. + span.innerHTML = `⚠️ Omnisearch will soon require Text Extractor to index PDFs and images. You can already install it to get a head start.` }) new Setting(containerEl).setDesc(label) } // PDF Indexing - if (!Platform.isMobileApp) { + if (!Platform.isMobileApp || getTextExtractor()) { const indexPDFsDesc = new DocumentFragment() indexPDFsDesc.createSpan({}, span => { - span.innerHTML = `Omnisearch will include PDFs in search results.
- ⚠️ PDFs first need to be processed. This can take anywhere from a few seconds to 2 minutes, then the resulting text is cached. - Needs a restart to fully take effect.` + span.innerHTML = `Include PDFs in search results - Will soon depend on Text Extractor.` }) new Setting(containerEl) - .setName('PDF Indexing') + .setName(`PDFs Indexing`) .setDesc(indexPDFsDesc) .addToggle(toggle => toggle.setValue(settings.PDFIndexing).onChange(async v => { @@ -115,21 +115,14 @@ export class SettingsTab extends PluginSettingTab { await saveSettings(this.plugin) }) ) - } - // Images Indexing - if (!Platform.isMobileApp) { + // Images Indexing const indexImagesDesc = new DocumentFragment() indexImagesDesc.createSpan({}, span => { - span.innerHTML = `Omnisearch will use Tesseract to index images from their text. - - Needs a restart to fully take effect.` + span.innerHTML = `Include images in search results - Will soon depend on Text Extractor.` }) new Setting(containerEl) - .setName('BETA - Images Indexing') + .setName(`Images Indexing`) .setDesc(indexImagesDesc) .addToggle(toggle => toggle.setValue(settings.imagesIndexing).onChange(async v => { @@ -138,6 +131,7 @@ export class SettingsTab extends PluginSettingTab { }) ) } + // Additional files to index const indexedFileTypesDesc = new DocumentFragment() indexedFileTypesDesc.createSpan({}, span => {