A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
core: support video,audio,document filter in attachments
Ammar Ahmedec1001067d97
diff --git a/packages/core/src/collections/attachments.ts b/packages/core/src/collections/attachments.tsindex 572768fce..0dd11a296 100644--- a/packages/core/src/collections/attachments.ts+++ b/packages/core/src/collections/attachments.ts@@ -242,7 +242,15 @@ export class Attachments implements ICollection {ofNote(noteId: string,- ...types: ("files" | "images" | "webclips" | "all")[]+ ...types: (+ | "files"+ | "images"+ | "videos"+ | "audio"+ | "documents"+ | "webclips"+ | "all"+ )[]) {const selector = this.db.relations.from({ type: "note", id: noteId },@@ -256,6 +264,16 @@ export class Attachments implements ICollection {const filters = [];if (types.includes("images"))filters.push(eb("mimeType", "like", `image/%`));++ if (types.includes("videos"))+ filters.push(eb("mimeType", "like", `video/%`));++ if (types.includes("audio"))+ filters.push(eb("mimeType", "like", `audio/%`));++ if (types.includes("documents"))+ filters.push(eb("mimeType", "in", DocumentMimeTypes));+if (types.includes("webclips"))filters.push(eb("mimeType", "==", `application/vnd.notesnook.web-clip`)