diff --git a/app/Main.hs b/app/Main.hs index a91c04c..799cb06 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -176,13 +176,13 @@ server cfg db = rootR :<|> todayR :<|> apiTodayR rootR = todayR 0 todayR issue = do - dateThen <- ExceptT get100YearsAgo + dateThen <- getTodayWithOffset (-100) 0 count <- DB.withConn db $ DB.getNumberOfIssues dateThen dayFile <- DB.withConn db $ DB.getDayFileByIssue dateThen issue pure $ RootModel dateThen dayFile issue count apiTodayR issue = do - dateThen <- ExceptT get100YearsAgo + dateThen <- getTodayWithOffset (-100) 0 dayFile <- DB.withConn db $ DB.getDayFileByIssue dateThen issue let fullPath = cfg.yoreDownloadDir dayFile.relative_path secondsUntilMidnight <- liftIO getSecondsUntilMidnight @@ -230,9 +230,6 @@ instance MimeRender HTML RootModel where -- Utils -get100YearsAgo :: IO (Either Error Day) -get100YearsAgo = runExceptT $ getTodayWithOffset (-100) 0 - getTodayWithOffset :: Integer -> Integer -> ExceptT Error IO Day getTodayWithOffset yearOffset dayOffset = ExceptT $