From 6c4869f8a8210563c9c27fed244690f3f1194f8b Mon Sep 17 00:00:00 2001 From: WS64 Date: Wed, 27 Aug 2014 09:17:54 +0200 Subject: [PATCH] Only use registered file types in search --- .../apps/filemanager/filemanagersearch.lua | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/frontend/apps/filemanager/filemanagersearch.lua b/frontend/apps/filemanager/filemanagersearch.lua index c7d99918c..f026f7b87 100644 --- a/frontend/apps/filemanager/filemanagersearch.lua +++ b/frontend/apps/filemanager/filemanagersearch.lua @@ -333,25 +333,26 @@ function Search:find(option) self.browse_tags[string.sub(j,2)] = (self.browse_tags[string.sub(j,2)] or 0) + 1 end end - - if upsearch ~= "" then - if string.find(dummy,upsearch,nil,true) then - i = i + 1 - end - else - if option == "series" then - if self.browse_series[self.data[i][self.series]] then + if DocumentRegistry:getProvider(self.data[i][self.path]) then + if upsearch ~= "" then + if string.find(dummy,upsearch,nil,true) then i = i + 1 end - elseif option == "tags" then - local found = false - for j in string.gmatch(self.data[i][self.tags3],"\t[^\t]+") do - if j~="\t" and self.browse_tags[string.sub(j,2)] then - found = true + else + if option == "series" then + if self.browse_series[self.data[i][self.series]] then + i = i + 1 + end + elseif option == "tags" then + local found = false + for j in string.gmatch(self.data[i][self.tags3],"\t[^\t]+") do + if j~="\t" and self.browse_tags[string.sub(j,2)] then + found = true + end + end + if found then + i = i + 1 end - end - if found then - i = i + 1 end end end