Index base files (#480)
* Index base files * Do not index bases content --------- Co-authored-by: Simon Cambier <simon.cambier@protonmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
import {
|
import {
|
||||||
getExtension,
|
getExtension,
|
||||||
isFileCanvas,
|
isFileCanvas,
|
||||||
|
isFileBase,
|
||||||
isFileExcalidraw,
|
isFileExcalidraw,
|
||||||
isFileImage,
|
isFileImage,
|
||||||
isFilePDF,
|
isFilePDF,
|
||||||
@@ -135,7 +136,7 @@
|
|||||||
setIcon(elFilePathIcon, 'image')
|
setIcon(elFilePathIcon, 'image')
|
||||||
} else if (isFilePDF(note.path)) {
|
} else if (isFilePDF(note.path)) {
|
||||||
setIcon(elFilePathIcon, 'file-text')
|
setIcon(elFilePathIcon, 'file-text')
|
||||||
} else if (isFileCanvas(note.path) || isFileExcalidraw(note.path)) {
|
} else if (isFileCanvas(note.path) || isFileExcalidraw(note.path) || isFileBase(note.path)) {
|
||||||
setIcon(elFilePathIcon, 'layout-dashboard')
|
setIcon(elFilePathIcon, 'layout-dashboard')
|
||||||
} else {
|
} else {
|
||||||
setIcon(elFilePathIcon, 'file')
|
setIcon(elFilePathIcon, 'file')
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { removeAnchors } from './tools/notes'
|
|||||||
import type { IndexedDocument } from './globals'
|
import type { IndexedDocument } from './globals'
|
||||||
import {
|
import {
|
||||||
isFileCanvas,
|
isFileCanvas,
|
||||||
|
isFileBase,
|
||||||
isFileFromDataloom,
|
isFileFromDataloom,
|
||||||
isFileImage,
|
isFileImage,
|
||||||
isFilePDF,
|
isFilePDF,
|
||||||
@@ -63,6 +64,7 @@ export class NotesIndexer {
|
|||||||
this.canIndexUnsupportedFiles() ||
|
this.canIndexUnsupportedFiles() ||
|
||||||
this.isFilePlaintext(path) ||
|
this.isFilePlaintext(path) ||
|
||||||
isFileCanvas(path) ||
|
isFileCanvas(path) ||
|
||||||
|
isFileBase(path) ||
|
||||||
isFileFromDataloom(path)
|
isFileFromDataloom(path)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
isFileImage,
|
isFileImage,
|
||||||
isFilePDF,
|
isFilePDF,
|
||||||
isFileCanvas,
|
isFileCanvas,
|
||||||
|
isFileBase,
|
||||||
isFileExcalidraw,
|
isFileExcalidraw,
|
||||||
warnVerbose,
|
warnVerbose,
|
||||||
} from './utils'
|
} from './utils'
|
||||||
@@ -183,7 +184,7 @@ export function getDefaultIconSVG(notePath: string): string {
|
|||||||
iconName = 'image'
|
iconName = 'image'
|
||||||
} else if (isFilePDF(notePath)) {
|
} else if (isFilePDF(notePath)) {
|
||||||
iconName = 'file-text'
|
iconName = 'file-text'
|
||||||
} else if (isFileCanvas(notePath) || isFileExcalidraw(notePath)) {
|
} else if (isFileCanvas(notePath) || isFileExcalidraw(notePath) || isFileBase(notePath)) {
|
||||||
iconName = 'layout-dashboard'
|
iconName = 'layout-dashboard'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,6 +178,10 @@ export function isFileCanvas(path: string): boolean {
|
|||||||
return path.endsWith('.canvas')
|
return path.endsWith('.canvas')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isFileBase(path: string): boolean {
|
||||||
|
return path.endsWith('.base')
|
||||||
|
}
|
||||||
|
|
||||||
export function isFileExcalidraw(path: string): boolean {
|
export function isFileExcalidraw(path: string): boolean {
|
||||||
return path.endsWith('.excalidraw')
|
return path.endsWith('.excalidraw')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user