Fixed pdf/images indexing on mobile
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
|||||||
parseFrontMatterAliases,
|
parseFrontMatterAliases,
|
||||||
Platform,
|
Platform,
|
||||||
} from 'obsidian'
|
} from 'obsidian'
|
||||||
import type { SearchMatch } from '../globals'
|
import { getTextExtractor, type SearchMatch } from '../globals'
|
||||||
import {
|
import {
|
||||||
excerptAfter,
|
excerptAfter,
|
||||||
excerptBefore,
|
excerptBefore,
|
||||||
@@ -231,11 +231,13 @@ export function getCtrlKeyLabel(): 'ctrl' | '⌘' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isFileIndexable(path: string): boolean {
|
export function isFileIndexable(path: string): boolean {
|
||||||
|
const canIndexPDF = (!Platform.isMobileApp || !!getTextExtractor()) && settings.PDFIndexing
|
||||||
|
const canIndexImages = (!Platform.isMobileApp || !!getTextExtractor()) && settings.imagesIndexing
|
||||||
return (
|
return (
|
||||||
isFilePlaintext(path) ||
|
isFilePlaintext(path) ||
|
||||||
isFileCanvas(path) ||
|
isFileCanvas(path) ||
|
||||||
(!Platform.isMobileApp && settings.PDFIndexing && isFilePDF(path)) ||
|
(canIndexPDF && isFilePDF(path)) ||
|
||||||
(!Platform.isMobileApp && settings.imagesIndexing && isFileImage(path))
|
(canIndexImages && isFileImage(path))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user