diff options
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 9 |
1 files changed, 5 insertions, 4 deletions
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 |