diff --git a/Handler/Search.hs b/Handler/Search.hs index 23efc89..1b09a48 100755 --- a/Handler/Search.hs +++ b/Handler/Search.hs @@ -20,7 +20,7 @@ import Import import qualified Data.Text as T import Data.Maybe (fromJust) -import Data.List (sortBy) +import Data.List (sortBy, nub) import Database.Persist.Sql (rawSql) @@ -37,7 +37,7 @@ getSearchR = do [PersistText query] b <- rawSql "select ?? from medium where ? % any(string_to_array(description, ' '))" [PersistText query] - return $ sortBy (\ sa sb -> compare + return $ nub $ sortBy (\ sa sb -> compare (T.unpack $ mediumTitle $ entityVal sa) (T.unpack $ mediumTitle $ entityVal sb)) $ a ++ b diff --git a/eidolon.cabal b/eidolon.cabal index 1d0c5c5..c07da65 100755 --- a/eidolon.cabal +++ b/eidolon.cabal @@ -1,5 +1,5 @@ name: eidolon -version: 0.1.11.4 +version: 0.1.11.5 synopsis: Image gallery in Yesod homepage: https://eidolon.nek0.eu license: AGPL-3