feat: implement background processing for binary attachments in Obsidian plugin

- Added a new Celery task for indexing non-markdown attachments.
- Enhanced the Obsidian plugin schema to support binary attachments.
- Updated routes to enqueue binary attachments for background processing.
- Improved metadata handling for binary attachments during indexing.
- Added tests for binary attachment processing and validation.
This commit is contained in:
Anish Sarkar 2026-04-22 23:00:34 +05:30
parent 5047527b47
commit 6ac5256431
11 changed files with 519 additions and 68 deletions

View file

@ -52,6 +52,24 @@ class NotePayload(_PluginBase):
content_hash: str = Field(
..., description="Plugin-computed SHA-256 of the raw content"
)
is_binary: bool = Field(
default=False,
description=(
"True when payload represents a non-markdown attachment. "
"If set, the plugin may include binary_base64 for ETL extraction."
),
)
binary_base64: str | None = Field(
default=None,
description=(
"Base64-encoded raw file bytes for binary attachments. "
"Used by the backend ETL pipeline."
),
)
mime_type: str | None = Field(
default=None,
description="Optional MIME type hint for binary attachments.",
)
size: int | None = Field(
default=None,
ge=0,
@ -138,7 +156,7 @@ class HealthResponse(_PluginBase):
class SyncAckItem(_PluginBase):
path: str
status: Literal["ok", "error"]
status: Literal["ok", "queued", "error"]
document_id: int | None = None
error: str | None = None