removed unsafePerformIO from feed generation
This commit is contained in:
parent
07e3e526d0
commit
5a767f5076
1 changed files with 4 additions and 4 deletions
|
@ -28,7 +28,6 @@ import Yesod.RssFeed
|
||||||
import Yesod.AtomFeed
|
import Yesod.AtomFeed
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
import qualified System.Posix as P
|
import qualified System.Posix as P
|
||||||
import System.IO.Unsafe
|
|
||||||
|
|
||||||
getCommentFeedRssR :: MediumId -> Handler RepRss
|
getCommentFeedRssR :: MediumId -> Handler RepRss
|
||||||
getCommentFeedRssR mId = do
|
getCommentFeedRssR mId = do
|
||||||
|
@ -183,8 +182,9 @@ rootFeedBuilder = do
|
||||||
, feedEntries = es
|
, feedEntries = es
|
||||||
}
|
}
|
||||||
|
|
||||||
mediumToEntry :: Monad m => Entity Medium -> m (FeedEntry (Route App))
|
mediumToEntry :: MonadIO m => Entity Medium -> m (FeedEntry (Route App))
|
||||||
mediumToEntry ent =
|
mediumToEntry ent = do
|
||||||
|
size <- liftIO $ getSize $ L.tail $ mediumPreview $ entityVal ent
|
||||||
return FeedEntry
|
return FeedEntry
|
||||||
{ feedEntryLink = MediumR (entityKey ent)
|
{ feedEntryLink = MediumR (entityKey ent)
|
||||||
, feedEntryUpdated = mediumTime (entityVal ent)
|
, feedEntryUpdated = mediumTime (entityVal ent)
|
||||||
|
@ -192,7 +192,7 @@ mediumToEntry ent =
|
||||||
, feedEntryContent = toHtml (fromMaybe (Textarea "") $ mediumDescription $ entityVal ent)
|
, feedEntryContent = toHtml (fromMaybe (Textarea "") $ mediumDescription $ entityVal ent)
|
||||||
, feedEntryEnclosure = Just
|
, feedEntryEnclosure = Just
|
||||||
( StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPreview $ entityVal ent) []
|
( StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPreview $ entityVal ent) []
|
||||||
, unsafePerformIO $ getSize $ L.tail $ mediumPreview $ entityVal ent
|
, size
|
||||||
, "image/jpeg"
|
, "image/jpeg"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue