Remove get100YearsAgo
This commit is contained in:
parent
0bf734730b
commit
05943c902e
@ -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 $
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user