Drop support for building with old versions of directory, feed, and http-types.

This commit is contained in:
Joey Hess 2017-03-10 15:57:41 -04:00
parent 9ef7207d5a
commit 1c4e5f65fc
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
5 changed files with 6 additions and 28 deletions

View file

@ -272,24 +272,16 @@ feedFile tmpl i extension = Utility.Format.format tmpl $
, extractField "itempubdate" [pubdate $ item i]
]
where
#if MIN_VERSION_feed(0,3,9)
pubdate itm = case getItemPublishDate itm :: Maybe (Maybe UTCTime) of
Just (Just d) -> Just $
formatTime defaultTimeLocale "%F" d
-- if date cannot be parsed, use the raw string
_ -> replace "/" "-" <$> getItemPublishDateString itm
#else
pubdate _ = Nothing
#endif
extractMetaData :: ToDownload -> MetaData
#if MIN_VERSION_feed(0,3,9)
extractMetaData i = case getItemPublishDate (item i) :: Maybe (Maybe UTCTime) of
Just (Just d) -> unionMetaData meta (dateMetaData d meta)
_ -> meta
#else
extractMetaData i = meta
#endif
where
tometa (k, v) = (mkMetaFieldUnchecked k, S.singleton (toMetaValue v))
meta = MetaData $ M.fromList $ map tometa $ extractFields i