updateItem c (RSSItem t u f d a g p eu et id      urd) = do update_if c t  id "title"
                                                            update_if c u  id "url"
                                                            update_if c f  id "feedurl"
                                                            update_if c d  id "content"
                                                            update_if c a  id "author"
                                                            update_if c g  id "guid"
                                                            update_if c p  id "pubDate"
                                                            update_if c eu id "enclosure_url"
                                                            update_if c et id "enclosure_type"
                                                            update_if c ur id "unread"
    where ur = bti urd
          update_if _ Nothing   _        _ = return()
          update_if c (Just v) (Just id) s = do run c ("UPDATE rss_item SET " ++ s ++ " = ? WHERE id = ?") [toSql v, toSql id]
                                                return()
          bti :: Maybe Bool -> Maybe Int
          bti Nothing      = Nothing
          bti (Just True)  = Just 1
          bti (Just False) = Just 0

-- Load RSSFeeds from url file ---------------------------------------
updateItem c (RSSItem t u f d a g p eu et id      urd) = do update_if c t  id "title"
                                                            update_if c u  id "url"
                                                            update_if c f  id "feedurl"
                                                            update_if c d  id "content"
                                                            update_if c a  id "author"
                                                            update_if c g  id "guid"
                                                            update_if c p  id "pubDate"
                                                            update_if c eu id "enclosure_url"
                                                            update_if c et id "enclosure_type"
                                                            update_if c ur id "unread"
    where ur = bti urd
          update_if _ Nothing   _        _ = return()
          update_if c (Just v) (Just id) s = do run c ("UPDATE rss_item SET " ++ s ++ " = ? WHERE id = ?") [toSql v, toSql id]
                                                return()
          bti :: Maybe Bool -> Maybe Int
          bti Nothing      = Nothing
          bti (Just True)  = Just 1
          bti (Just False) = Just 0

-- Load RSSFeeds from url file ---------------------------------------
updateItem c (RSSItem t u f d a g p eu et id      urd) = do update_if c t  id "title"
                                                            update_if c u  id "url"
                                                            update_if c f  id "feedurl"
                                                            update_if c d  id "content"
                                                            update_if c a  id "author"
                                                            update_if c g  id "guid"
                                                            update_if c p  id "pubDate"
                                                            update_if c eu id "enclosure_url"
                                                            update_if c et id "enclosure_type"
                                                            update_if c ur id "unread"
    where ur = bti urd
          update_if _ Nothing   _        _ = return()
          update_if c (Just v) (Just id) s = do run c ("UPDATE rss_item SET " ++ s ++ " = ? WHERE id = ?") [toSql v, toSql id]
                                                return()
          bti :: Maybe Bool -> Maybe Int
          bti Nothing      = Nothing
          bti (Just True)  = Just 1
          bti (Just False) = Just 0

-- Load RSSFeeds from url file ---------------------------------------