feat(Processor): support setting extension to empty to indicate no extension restriction

This commit is contained in:
shiyu
2025-09-27 14:11:59 +08:00
parent 0da64b8d9c
commit 7f33eb85ba
2 changed files with 6 additions and 2 deletions

View File

@@ -61,7 +61,11 @@ export const ContextMenu: React.FC<ContextMenuProps> = (props) => {
if (!entry.is_dir && processorTypes.length > 0) {
const ext = entry.name.split('.').pop()?.toLowerCase() || '';
processorSubMenu = processorTypes
.filter(pt => pt.supported_exts.includes(ext))
.filter(pt => {
const exts = pt.supported_exts;
if (!Array.isArray(exts) || exts.length === 0) return true;
return exts.includes(ext);
})
.map(pt => ({
key: 'processor-' + pt.type,
label: pt.name,