diff options
| -rw-r--r-- | app/Main.hs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/Main.hs b/app/Main.hs index 132e132..ad7a575 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -210,7 +210,6 @@ app AppData{..} request respond = mkAnswer >>= (respond . toResponse) & maybeAnswer (Plaintext . unRil100) Fuzzy (_,match) -> Redirect (ril100BaseUrl <> "/" <> match) where query = T.intercalate "/" (pathInfo request) - _ -> pure Notfound queriedRil100 :: Text -> MatchResult Ril100 Text queriedRil100 query = if | not (T.any isLower query) && host `elem` ["leitpunkt"] @@ -218,18 +217,13 @@ app AppData{..} request respond = mkAnswer >>= (respond . toResponse) & maybe None Exact | not (T.any isLower query) -> Exact (Ril100 query) - | host `elem` ["leitpunkt"] - -> case findStationName query ril100set of - None -> None - Exact (_,match) -> lookupName match ril100map - & maybe None Exact - Fuzzy (_,match) -> Fuzzy (leitpunktBaseUrl <> "/" <> match) | otherwise -> case findStationName query ril100set of None -> None Exact (_,match) -> lookupName match ril100map & maybe None Exact - Fuzzy (_,match) -> Fuzzy (ril100BaseUrl <> "/" <> match) + Fuzzy (_,match) -> Fuzzy (baseUrl <> "/" <> match) + where baseUrl = if host `elem` ["leitpunkt"] then leitpunktBaseUrl else ril100BaseUrl helptext = Html $ "\ \<pre>\ \ril100 → Name: " <> ril100BaseUrl <> "/RM\n\ |
