From 3810c776c74062218083f05b05a8f68e3f21bb07 Mon Sep 17 00:00:00 2001 From: Zain Date: Tue, 30 Dec 2025 16:27:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8):=20=E6=B7=BB=E5=8A=A0=E9=9F=B3=E9=A2=91=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在文件选择器中新增音频类型支持,包括: 1. 在类型定义中添加audio类型 2. 在工具栏下拉菜单中添加音频选项 3. 添加音频文件扩展名检测逻辑 4. 更新多语言翻译文件 --- src/content/components/file-selector-panel.ts | 2 ++ src/content/components/toolbar.ts | 1 + src/locales/en.json | 1 + src/locales/zh_CN.json | 1 + src/locales/zh_TW.json | 1 + src/shared/version.ts | 2 +- src/types/file-selector.ts | 2 +- 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/content/components/file-selector-panel.ts b/src/content/components/file-selector-panel.ts index 664fd1a..ae250d0 100644 --- a/src/content/components/file-selector-panel.ts +++ b/src/content/components/file-selector-panel.ts @@ -250,10 +250,12 @@ export class FileSelectorPanel extends LitElement { const videoExts = ['.mp4', '.avi', '.mkv', '.mov', '.wmv', '.flv', '.webm', '.m4v']; const imageExts = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.webp', '.ico']; + const audioExts = ['.mp3', '.wav', '.flac', '.aac', '.m4a', '.ogg', '.opus', '.wma']; const docExts = ['.pdf', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.txt', '.md']; if (videoExts.includes(lowerExt)) return 'video'; if (imageExts.includes(lowerExt)) return 'image'; + if (audioExts.includes(lowerExt)) return 'audio'; if (docExts.includes(lowerExt)) return 'document'; return 'other'; } diff --git a/src/content/components/toolbar.ts b/src/content/components/toolbar.ts index cd59cf8..3fdbc23 100644 --- a/src/content/components/toolbar.ts +++ b/src/content/components/toolbar.ts @@ -144,6 +144,7 @@ export class Toolbar extends LitElement { + diff --git a/src/locales/en.json b/src/locales/en.json index 90c3136..7ece030 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -23,6 +23,7 @@ "all_types": "All Types", "type_video": "Video", "type_image": "Image", + "type_audio": "Audio", "type_document": "Document", "type_other": "Other", "selected_files_count": "Selected $1 / $2 files", diff --git a/src/locales/zh_CN.json b/src/locales/zh_CN.json index 46b11b5..9df84ba 100644 --- a/src/locales/zh_CN.json +++ b/src/locales/zh_CN.json @@ -23,6 +23,7 @@ "all_types": "全部类型", "type_video": "视频", "type_image": "图片", + "type_audio": "音频", "type_document": "文档", "type_other": "其他", "selected_files_count": "已选择 $1 / $2 个文件", diff --git a/src/locales/zh_TW.json b/src/locales/zh_TW.json index 69cdf32..e5504f0 100644 --- a/src/locales/zh_TW.json +++ b/src/locales/zh_TW.json @@ -23,6 +23,7 @@ "all_types": "所有類型", "type_video": "影片", "type_image": "圖片", + "type_audio": "音訊", "type_document": "文件", "type_other": "其他", "selected_files_count": "已選擇 $1 / $2 個檔案", diff --git a/src/shared/version.ts b/src/shared/version.ts index 869a83b..124d00d 100644 --- a/src/shared/version.ts +++ b/src/shared/version.ts @@ -10,7 +10,7 @@ * 1. Edit version in package.json * 2. Run: npm run sync:version (or automatically via prebuild/predev) * - * Generated at: 2025-12-30T08:01:25.159Z + * Generated at: 2025-12-30T08:23:44.405Z */ /** diff --git a/src/types/file-selector.ts b/src/types/file-selector.ts index 9b97902..f303ec9 100644 --- a/src/types/file-selector.ts +++ b/src/types/file-selector.ts @@ -4,7 +4,7 @@ import { RuleConfig } from './rule'; /** * File type categories for filtering */ -export type FileType = 'video' | 'image' | 'document' | 'other'; +export type FileType = 'video' | 'image' | 'audio' | 'document' | 'other'; /** * Preview item for the preview panel