Skip to content

feat: add audio download support and fix filename sanitization - #9

Closed
dafeix wants to merge 2 commits into
leonardsellem:mainfrom
dafeix:main
Closed

feat: add audio download support and fix filename sanitization#9
dafeix wants to merge 2 commits into
leonardsellem:mainfrom
dafeix:main

Conversation

@dafeix

@dafeix dafeix commented May 31, 2026

Copy link
Copy Markdown

修改内容

1. 新增音频文件同步下载

  • API 客户端新增 downloadAudio 方法,调用 /file/download/{fileId} 端点获取 OGG 音频
  • Vault 适配器新增 createBinary 方法,支持写入二进制文件
  • 同步循环中自动下载音频到 audio/ 子目录,并在笔记中嵌入 ![[audio/plaud-audio-xxx.ogg]]

2. 修复中文标题文件名

  • slugify 函数从 toLowerCase().replace(/[^a-z0-9]+/g, "-") 改为 replace(/[\/:*?"<>|]+/g, "-")
  • 移除 toLowerCase(),保留原标题大小写
  • 仅过滤 Windows 文件系统非法字符,不再删除中文等非 ASCII 字符

dafeix added 2 commits May 31, 2026 12:54
- Add downloadAudio method to PlaudApiClient interface
- Add createBinary method to PlaudVaultAdapter interface
- Implement audio download via /file/download/{fileId} endpoint
- Save OGG audio files to audio/ subdirectory with Obsidian embed
- Fix slugify to preserve non-ASCII characters (Chinese titles)
- Remove toLowerCase() to keep original title casing
@dafeix dafeix closed this by deleting the head repository Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant