Don't recalculate metadata on matches when organizing by directory

This commit is contained in:
Joshua Clayton 2016-05-04 06:00:50 -04:00
parent 961585ce6e
commit 00c239fddb

View File

@ -106,9 +106,11 @@ responseForPath :: DirectoryPrefix -> TermMatchSet -> TermMatchSet
responseForPath s =
filterVByPath . filterKVByPath
where
filterVByPath = Map.map (resultsFromMatches . filter (((==) s) . fileNameGrouping . tmPath) . trMatches)
filterVByPath = Map.map (updateMatchesWith newMatches)
filterKVByPath = Map.filterWithKey (\_ a -> s `elem` allPaths a)
allPaths = fmap (fileNameGrouping . tmPath) . trMatches
updateMatchesWith f tr = tr { trMatches = f tr }
newMatches = (filter (((==) s) . fileNameGrouping . tmPath) . trMatches)
fileNameGrouping :: String -> DirectoryPrefix
fileNameGrouping =