From 1a64f6be2c5e8e5177ec157df737b8db96ea9ec0 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 18 Sep 2019 15:54:16 +0100 Subject: [PATCH] [Minor] Multimap: Exclude text parts and multiparts --- src/plugins/lua/multimap.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 7afe6dfb4..aee98f6b2 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -859,7 +859,12 @@ local function multimap_callback(task, rule) end, filename = function() local parts = task:get_parts() - for _,p in ipairs(parts) do + + local function filter_parts(p) + return (not p:is_text()) and (not p:is_multipart()) + end + + for p in fun.iter(fun.filter(filter_parts, parts)) do if p:is_archive() and not rule['skip_archives'] then local fnames = p:get_archive():get_files() -- 2.39.5