Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

feat(server): add transcript block indexing (#11487)

darkskygitea9de7b542ed
diff --git a/packages/backend/server/src/core/utils/blocksuite.ts b/packages/backend/server/src/core/utils/blocksuite.ts
index 6755900124..b5d76ffb0c 100644
--- a/packages/backend/server/src/core/utils/blocksuite.ts
+++ b/packages/backend/server/src/core/utils/blocksuite.ts
@@ -25,7 +25,10 @@ type KnownFlavour =
| 'affine:paragraph'
| 'affine:list'
| 'affine:code'
- | 'affine:image';
+ | 'affine:image'
+ | 'affine:attachment'
+ | 'affine:transcription'
+ | 'affine:callout';
export function parseWorkspaceDoc(doc: Doc): WorkspaceDocContent | null {
// not a workspace doc
@@ -106,6 +109,15 @@ export function parsePageDoc(
pushChildren(block);
break;
}
+ case 'affine:attachment':
+ case 'affine:transcription':
+ case 'affine:callout': {
+ // only extract text in full content mode
+ if (summaryLenNeeded === -1) {
+ pushChildren(block);
+ }
+ break;
+ }
case 'affine:paragraph':
case 'affine:list':
case 'affine:code': {
@@ -120,9 +132,8 @@ export function parsePageDoc(
} else if (summaryLenNeeded > 0) {
content.summary += text.toString();
summaryLenNeeded -= text.length;
- } else {
- break;
}
+ break;
}
}
}