fix build with old feed

This commit is contained in:
Joey Hess 2014-07-19 18:30:08 -04:00
parent a8560d932c
commit d15bfc9061

View file

@ -227,9 +227,13 @@ feedFile tmpl i extension = Utility.Format.format tmpl $
#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