From 20231d809b57c3050fb1cd812ea4c6e66cdaf6fb Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 28 May 2022 00:48:52 +1000 Subject: time and map updates --- src/Main.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index f3f8a5a..133d155 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -10,10 +10,11 @@ import System.FilePath main :: IO () main = do - (feeds, maildir) <- getUserdata "./.f2m.json" + (feeds, maildir, dbPath) <- getUserdata "./.f2m.json" whenJust maildir $ \root -> do mapM_ (createDirectoryIfMissing True) [root "new", root "cur", root "tmp"] - messages <- (fmap concat . sequence) $ - (\feed -> toMessagesFromUrl (url feed) (lastUpdated feed)) <$> feeds - mapM_ (writeMessage root) messages + feedMessages <- sequence $ + (\feed -> toMessagesFromUrl (fuUrl feed) (fuLastUpdated feed)) <$> feeds + mapM_ (writeMessage root) $ concat feedMessages + whenJust dbPath $ \dbPath' -> updateLastUpdated dbPath' feeds feedMessages -- cgit v1.2.3